[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/k3b/libk3b/projects/datacd
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2006-09-06 12:14:36
Message-ID: 1157544876.777559.32091.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 581439 by trueg:

Wait for the writer job to finish when the job has been cancelled.
This is more a workaround than a real fix but it should do the trick.
For K3b 2.0 I will redesign this more cleanly.

BUG: 133615


 M  +25 -4     k3bdatajob.cpp  


--- trunk/extragear/multimedia/k3b/libk3b/projects/datacd/k3bdatajob.cpp #581438:581439
@@ -247,9 +247,21 @@
   emit infoMessage( i18n("Writing canceled."), K3bJob::ERROR );
   emit canceled();
 
-  cancelAll();
-
-  jobFinished( false );
+  if( m_writerJob && m_writerJob->active() ) {
+    //
+    // lets wait for the writer job to finish
+    // and let it finish the job for good.
+    //
+    cancelAll();
+  }
+  else {
+    //
+    // Just cancel all and return
+    // This is bad design as we should wait for all subjobs to finish
+    //
+    cancelAll();
+    jobFinished( false );
+  }
 }
 
 
@@ -332,7 +344,7 @@
       if( m_writerJob && m_writerJob->active() )
 	m_writerJob->setSourceUnreadable( true );
 
-      // there is one special case which we need to handle here: the iso imager might be cancelled 
+      // there is one special case which we need to handle here: the iso imager might be canceled 
       // FIXME: the iso imager should not be able to cancel itself
       if( m_isoImager->hasBeenCanceled() && !this->hasBeenCanceled() )
 	cancel();
@@ -390,6 +402,15 @@
 
 void K3bDataJob::slotWriterJobFinished( bool success )
 {
+  //
+  // This is a little workaround for the bad cancellation handling in this job
+  // see cancel()
+  //
+  if( d->canceled ) {
+    if( active() )
+      jobFinished( false );
+  }
+
   if( success ) {
     // allright
     // the writerJob should have emited the "simulation/writing successful" signal
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic