Bug 98287

Summary: Moving Images while in Photobook view causes a sigsegv
Product: [Applications] konqueror Reporter: Alex Wright <bugzilla>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: charles
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alex Wright 2005-01-31 18:38:23 UTC
Version:           3.3.91 (using KDE KDE 3.3.91)
Installed from:    Gentoo Packages
Compiler:          gcc 3.4.3 
OS:                Linux

How to reproduce:
View a folder with images (tested with jpeg) using the photo view.
Select an image from the list on the right hand side, and drag it to a folder in the folder view on the left hand side, while holding the shift key.
Upon releasing the key, Konqueror crashes.

I've tried to compile with symbols, but no luck at getting a backtrace so far! (help!)
Comment 1 Alex Wright 2005-01-31 19:59:44 UTC
A crash also occurs if you drag a file, then select move from the menu. Copying doesn't cause a crash.
Comment 2 Charles Samuels 2005-01-31 20:10:57 UTC
Yes, absolutely does exist.

I can't think of a way to fix this because it's caused by KFileIconView::firstFileItem() giving me an invalid item.

Can a KFile developer please tell me if there's something I'm missing?

thanks.
Comment 3 Charles Samuels 2005-02-05 19:03:17 UTC
CVS commit by charles: 

BUG:98287
Fix a crash when files go away.

Thanks Waldo for the advice!


  M +10 -0     photobook.cpp   1.10
  M +1 -0      photobook.h   1.8


--- kdegraphics/kview/photobook/photobook.cpp  #1.9:1.10
@@ -61,4 +61,8 @@ Previews::Previews(PhotoBook *parent, co
                         SLOT(open(const KFileItem*))
                 );
+        connect(
+                        &mDirLister, SIGNAL(deleteItem(KFileItem *)),
+                        SLOT(removeItem(KFileItem *))
+                );
 
         setFixedWidth(128);
@@ -87,4 +91,10 @@ void Previews::insertNewFiles(const KFil
 }
 
+void Previews::removeItem(KFileItem *item)
+{
+        KFileIconView::removeItem(item);
+}
+
+
 void Previews::go(const KFileItem *k)
 {

--- kdegraphics/kview/photobook/photobook.h  #1.7:1.8
@@ -96,4 +96,5 @@ private slots:
         void slotStarted();
         void insertNewFiles(const KFileItemList &);
+        void removeItem(KFileItem *item);
         void open(const KFileItem*);
         void doneListing();