summaryrefslogtreecommitdiffstats
path: root/mandriva/2010.2/applications/k3b/verify-reload-fix.patch
blob: acba642c56796e4c92173056e8553373da8b6f6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
diff -ur k3b-1.0.4/ChangeLog k3b-1.0.4-verification-always-reload/ChangeLog
--- k3b-1.0.4/ChangeLog	2007-11-02 10:55:57.000000000 +0100
+++ k3b-1.0.4-verification-always-reload/ChangeLog	2007-12-07 19:33:18.000000000 +0100
@@ -4,9 +4,6 @@
  * Unmount medium before DVD formatting
  * Silently (without introducing new strings for translation) allow the burning of files
    bigger than 4 GB with appropriate versions of genisoimage or mkisofs.
- * Do only reload the medium before verification if necessary, i.e. if the newly written
-   track cannot be read otherwise (many old drives depend on this). Hopefully this will
-   at least work around the aweful "DMA disabled" bug for many users.
 	
 1.0.3
 =====
diff -ur k3b-1.0.4/libk3b/jobs/k3bverificationjob.cpp k3b-1.0.4-verification-always-reload/libk3b/jobs/k3bverificationjob.cpp
--- k3b-1.0.4/libk3b/jobs/k3bverificationjob.cpp	2007-11-02 10:55:53.000000000 +0100
+++ k3b-1.0.4-verification-always-reload/libk3b/jobs/k3bverificationjob.cpp	2007-07-21 21:53:53.000000000 +0200
@@ -84,8 +84,6 @@
   K3bPipe pipe;
 
   bool readSuccessful;
-
-  bool mediumHasBeenReloaded;
 };
 
 
@@ -151,13 +149,11 @@
   d->currentTrackIndex = 0;
   d->alreadyReadSectors = 0;
 
-  emit newTask( i18n("Checking medium") );
+  // first we need to reload and mount the device
+  emit newTask( i18n("Reloading the medium") );
 
-  d->mediumHasBeenReloaded = false;
-  connect( K3bDevice::sendCommand( K3bDevice::DeviceHandler::DISKINFO, d->device ),
-           SIGNAL(finished(K3bDevice::DeviceHandler*)),
-           this,
-           SLOT(slotDiskInfoReady(K3bDevice::DeviceHandler*)) );
+  connect( K3bDevice::reload( d->device ), SIGNAL(finished(bool)),
+	   this, SLOT(slotMediaReloaded(bool)) );
 }
 
 
@@ -165,7 +165,6 @@
                   K3bDevice::STATE_COMPLETE|K3bDevice::STATE_INCOMPLETE,
                   K3bDevice::MEDIA_WRITABLE );
 
-  d->mediumHasBeenReloaded = true;
 
   emit newTask( i18n("Checking medium") );
 
@@ -191,6 +185,12 @@
   d->toc = dh->toc();
   d->totalSectors = 0;
 
+  if ( d->toc.isEmpty() ) {
+      emit infoMessage( i18n( "No tracks to verify found." ), ERROR );
+      jobFinished( false );
+      return;
+  }
+
   // just to be sure check if we actually have all the tracks
   int i = 0;
   for( QValueList<K3bVerificationJobTrackEntry>::iterator it = d->tracks.begin();
@@ -201,21 +201,9 @@
       (*it).trackNumber = d->toc.count();
 
     if( (int)d->toc.count() < (*it).trackNumber ) {
-        if ( d->mediumHasBeenReloaded ) {
-            emit infoMessage( i18n("Internal Error: Verification job improperly initialized (%1)")
-                              .arg( "Specified track number not found on medium" ), ERROR );
-            jobFinished( false );
-            return;
-        }
-        else {
-            // many drives need to reload the medium to return to a proper state
-            emit newTask( i18n("Reloading the medium") );
-            connect( K3bDevice::reload( d->device ),
-                     SIGNAL(finished(bool)),
-                     this,
-                     SLOT(slotMediaReloaded(bool)) );
-            return;
-        }
+      emit infoMessage( i18n("Internal Error: Verification job improperly initialized"), ERROR );
+      jobFinished( false );
+      return;
     }
 
     d->totalSectors += trackLength( i );