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

List:       kde-commits
Subject:    kdebase/konqueror/iconview
From:       Laurent Montel <montel () kde ! org>
Date:       2003-08-23 14:39:00
[Download RAW message or body]

CVS commit by mlaurent: 

Don't allow to execute a file which is into a trash.
This is a fix to create a real trash (before kio_trash)


  M +17 -7     konq_iconview.cc   1.440


--- kdebase/konqueror/iconview/konq_iconview.cc  #1.439:1.440
@@ -40,4 +40,5 @@
 #include <klocale.h>
 #include <kivdirectoryoverlay.h>
+#include <kmessagebox.h>
 
 #include <qregexp.h>
@@ -646,6 +647,15 @@ void KonqKfmIconView::slotReturnPressed(
     if ( !fileItem )
         return;
-
+    KURL url = fileItem->url();
+    url.cleanPath();
+    bool isIntoTrash =  url.isLocalFile() && \
url.path(1).startsWith(KGlobalSettings::trashPath()); +    if ( !isIntoTrash || \
(isIntoTrash && fileItem->isDir()) ) +    {
     lmbClicked( fileItem );
+    }
+    else
+    {
+        KMessageBox::information(0L, i18n("You must leave the file out of the trash \
before being able to use it.")); +    }
 }
 


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

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