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

List:       kde-commits
Subject:    kdeextragear-1/k3b/src/data
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2003-01-31 22:22:15
[Download RAW message or body]

CVS commit by trueg: 

bugfix: if current dir was subitem (but not direct child) of removed dir K3b crashed


  M +13 -22    k3bdatafileview.cpp   1.31


--- kdeextragear-1/k3b/src/data/k3bdatafileview.cpp  #1.30:1.31
@@ -182,26 +182,17 @@ void K3bDataFileView::slotDropped( QDrop
 void K3bDataFileView::slotDataItemRemoved( K3bDataItem* item )
 {
-  if( item == currentDir() )
-    {
+  if( item->isDir() ) {
+    if( ((K3bDirItem*)item)->isSubItem( currentDir() ) ) {
       slotSetCurrentDir( item->parent() );
-
-    }
-  if( item->parent() == currentDir() )
-    {
-      QListViewItemIterator it(this);
-      for( ; it.current(); ++it )
-        {
-          if( K3bDataDirViewItem* dirViewItem = \
                dynamic_cast<K3bDataDirViewItem*>(it.current()) ) {
-            if( dirViewItem->dirItem() == item ) {
-              delete it.current();
-              break;
             }
           }
-          else if( K3bDataFileViewItem* fileViewItem = \
                dynamic_cast<K3bDataFileViewItem*>(it.current()) ) {
-            if( fileViewItem->fileItem() == item ) {
+  
+  if( item->parent() == currentDir() ) {
+    QListViewItemIterator it(this);
+    for( ; it.current(); ++it ) {
+      if( ((K3bDataViewItem*)*it)->dataItem() == item ) {
               delete it.current();
               break;
             }
-          }
         } // for it
     }


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

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