Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > main-testing-src > by-pkgid > 6a6037a72fe4fe07e6ae3cf1acaf9d61 > files > 8

kdelibs4-4.4.5-0.1mdv2010.1.src.rpm

Index: kdelibs/kio/kio/jobuidelegate.h
===================================================================
--- kdelibs/kio/kio/jobuidelegate.h	(revision 1108647)
+++ kdelibs/kio/kio/jobuidelegate.h	(working copy)
@@ -100,10 +100,11 @@
                                       const QString & error_text);
 
     /**
-     * The type of deletion: real deletion, or moving the files to the trash
+     * The type of deletion: real deletion, moving the files to the trash
+     * or emptying the trash
      * Used by askDeleteConfirmation.
      */
-    enum DeletionType { Delete, Trash };
+    enum DeletionType { Delete, Trash, EmptyTrash };
     /**
      * ForceConfirmation: always ask the user for confirmation
      * DefaultConfirmation: don't ask the user if he/she said "don't ask again".
Index: kdelibs/kio/kio/jobuidelegate.cpp
===================================================================
--- kdelibs/kio/kio/jobuidelegate.cpp	(revision 1108647)
+++ kdelibs/kio/kio/jobuidelegate.cpp	(working copy)
@@ -108,7 +108,19 @@
     bool ask = ( confirmationType == ForceConfirmation );
     if (!ask) {
         KSharedConfigPtr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals);
-        keyName = (deletionType == Delete ? "ConfirmDelete" : "ConfirmTrash");
+	
+	switch (deletionType ) {
+	case Delete:
+	    keyName = "ConfirmDelete" ;
+	    break;
+	case Trash:
+	    keyName = "ConfirmTrash" ;
+	    break;
+	case EmptyTrash:
+	    keyName = "ConfirmEmptyTrash" ;
+	    break;
+	}
+
         // The default value for confirmations is true (for both delete and trash)
         // If you change this, update kdebase/apps/konqueror/settings/konq/behaviour.cpp
         const bool defaultValue = true;
@@ -141,7 +153,16 @@
 		KStandardGuiItem::cancel(),
 		keyName, KMessageBox::Notify);
             break;
-
+        case EmptyTrash: 
+	    result = KMessageBox::warningContinueCancel(
+	        widget,
+		i18nc("@info", "Do you really want to empty the trash? All items will be deleted."),
+		QString(),
+		KGuiItem(i18nc("@action:button", "Empty Trash"),
+		KIcon("user-trash")), 
+		KStandardGuiItem::cancel(), 
+		keyName, KMessageBox::Notify);
+	    break; 
         case Trash:
         default:
             result = KMessageBox::warningContinueCancelList(