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

List:       kde-commits
Subject:    k3b_0_11_branch: kdeextragear-1/k3b/src/projects/datacd
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2005-03-09 16:08:26
Message-ID: 20050309160826.9F7B010B25 () office ! kde ! org
[Download RAW message or body]

CVS commit by trueg: 

Backported fix for crash when importing session failed.


  M +7 -7      k3bdatadoc.cpp   1.21.2.8


--- kdeextragear-1/k3b/src/projects/datacd/k3bdatadoc.cpp  #1.21.2.7:1.21.2.8
@@ -1316,10 +1316,10 @@ void K3bDataDoc::importSession( K3bCdDev
 void K3bDataDoc::slotTocRead( K3bCdDevice::DeviceHandler* dh )
 {
-  if( dh->success() && !dh->toc().isEmpty() ) {
+  if( dh->success() && 
+      !dh->toc().isEmpty() &&
+      dh->toc().last().type() == K3bCdDevice::Track::DATA &&
+      dh->ngDiskInfo().appendable() ) {
     K3bCdDevice::Toc::const_iterator it = dh->toc().end();
-    --it; // this is valid since there is at least one data track
-    while( it != dh->toc().begin() && (*it).type() != K3bCdDevice::Track::DATA )
-      --it;
-    long startSec = (*it).firstSector().lba();
+    long startSec = dh->toc().last().firstSector().lba();
     
     // since in iso9660 it is possible that two files share it's data
@@ -1327,5 +1327,5 @@ void K3bDataDoc::slotTocRead( K3bCdDevic
     // that's why we use the size from the toc. This is more accurate
     // anyway since there might be files overwritten or removed
-    m_oldSessionSize = (*it).lastSector().mode1Bytes();
+    m_oldSessionSize = dh->toc().last().lastSector().mode1Bytes();
 
     kdDebug() << "(K3bDataDoc) imported session size: " << KIO::convertSize(m_oldSessionSize) << endl;


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

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