Bug 147439 - It is too easy to delete a search
Summary: It is too easy to delete a search
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Engine (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-02 01:04 UTC by Arnd Baecker
Modified: 2012-08-31 12:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.3


Attachments
introduce warningYesNo before deleting (1.06 KB, patch)
2007-07-02 01:07 UTC, Arnd Baecker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arnd Baecker 2007-07-02 01:04:35 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Compiled From Sources
OS:                Linux

Deleting a user-defined search is too easy.
Because there is no undo this 
destroys a complicated advanced search unrecoverably.
Comment 1 Arnd Baecker 2007-07-02 01:07:11 UTC
Created attachment 21011 [details]
introduce warningYesNo before deleting
Comment 2 Arnd Baecker 2007-08-30 15:38:15 UTC
Gilles, what about this patch, may I apply it
(just checked that it still compiles and works)?
Comment 3 caulier.gilles 2007-08-30 15:42:30 UTC
Arnd,

Fine for me. Let's go

Gilles
Comment 4 Arnd Baecker 2007-08-30 15:50:09 UTC
SVN commit 706464 by abaecker:

Add Yes/No Warning when deleting a search to avoid accidental removal of complex searches.
BUG: 147439


 M  +13 -0     searchfolderview.cpp  


--- branches/extragear/kde3/graphics/digikam/digikam/searchfolderview.cpp #706463:706464
@@ -35,6 +35,7 @@
 #include <kglobal.h>
 #include <kiconloader.h>
 #include <kdeversion.h>
+#include <kmessagebox.h>
 
 #if KDE_IS_VERSION(3,2,0)
 #include <kinputdialog.h>
@@ -270,6 +271,18 @@
     if (!album)
         return;
 
+    // Make sure that a complicated search is not deleted accidentally
+    int result =KMessageBox::warningYesNo( this, i18n("Are you sure you want to "
+                                                      "delete the selected search "
+                                                      "\"%1\"?")
+                                           .arg(album->title()),
+                                       i18n("Delete Search?"),
+                                       i18n("Delete"),
+                                       KStdGuiItem::cancel() );
+
+    if (result != KMessageBox::Yes)
+        return;
+
     AlbumManager::instance()->deleteSAlbum(album);
 }
 
Comment 5 caulier.gilles 2007-08-30 15:53:42 UTC
Arnd,

Warning. This patch much be backported to KDE4 implementation. Do not close it yet (:=)))

Gilles
Comment 6 caulier.gilles 2007-08-30 16:00:59 UTC
backported to KDE4 with commit #706466

Gilles