Bug 143412 - [PATCH] kuickshow crash - press 'delete' when nothing is highlighted
Summary: [PATCH] kuickshow crash - press 'delete' when nothing is highlighted
Status: RESOLVED FIXED
Alias: None
Product: kuickshow
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-24 08:31 UTC by David L Emerson
Modified: 2007-03-26 11:31 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David L Emerson 2007-03-24 08:31:51 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Debian testing/unstable Packages

1. open kuickshow
2. navigate to a "new" subdirectory (i.e., one that kuickshow has not opened yet)
3. observe that there is an outline around the first image file in the directory, but it is not actually highlighted
4. press 'delete'
5. kuickshow crashes

It also crashes if you open an empty directory and press delete.
Comment 1 Philip Rodrigues 2007-03-24 14:55:59 UTC
I only get the crash on pressing "delete" in an empty directory:

#13 0x290c3cd2 in operator!= () from /usr/X11R6/lib/libqt-mt.so.3
#14 0x28907119 in KURL::isLocalFile (this=0x8)
    at /home/phil/kdesrc/kdelibs/kdecore/kurl.cpp:1370
#15 0x2890830e in KURL::pathOrURL (this=0x8)
    at /home/phil/kdesrc/kdelibs/kdecore/kurl.cpp:1605
#16 0x2981aa0a in KuickShow::performTrashCurrentImage (this=0x81789a0, 
    parent=0x817f000)
    at /home/phil/kdesrc/kdegraphics/kuickshow/src/kuickshow.cpp:665
#17 0x2981a5f7 in KuickShow::slotTrashCurrentImage (this=0x81789a0)
    at /home/phil/kdesrc/kdegraphics/kuickshow/src/kuickshow.cpp:613
#18 0x2981df08 in KuickShow::qt_invoke (this=0x81789a0, _id=106, 
    _o=0xbfbfdae0) at kuickshow.moc:249
#19 0x28e191e0 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#20 0x28e19851 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#21 0x28599aa2 in KAction::activated (this=0x81a2f10) at kaction.moc:176
#22 0x285990c9 in KAction::slotActivated (this=0x81a2f10)
    at /home/phil/kdesrc/kdelibs/kdeui/kaction.cpp:1102
#23 0x28599ede in KAction::qt_invoke (this=0x81a2f10, _id=15, _o=0xbfbfdc20)
    at kaction.moc:218
Comment 2 Philip Rodrigues 2007-03-24 15:53:09 UTC
Easy fix, at least for the version of the crash I'm seeing:


Index: kuickshow.cpp
===================================================================
--- kuickshow.cpp       (revision 635141)
+++ kuickshow.cpp       (working copy)
@@ -660,6 +660,8 @@

     KFileItemList list;
     KFileItem *item = fileWidget->getCurrentItem(false);
+    if (!item) return;
+
     list.append (item);

     if (KMessageBox::warningContinueCancel(
Comment 3 Philip Rodrigues 2007-03-26 11:31:36 UTC
SVN commit 646111 by philrod:

Don't try to delete an item if there isn't one.

BUG:143412


 M  +2 -0      kuickshow.cpp  


--- branches/KDE/3.5/kdegraphics/kuickshow/src/kuickshow.cpp #646110:646111
@@ -660,6 +660,8 @@
 
     KFileItemList list;
     KFileItem *item = fileWidget->getCurrentItem(false);
+    if (!item) return;
+
     list.append (item);
 
     if (KMessageBox::warningContinueCancel(