[Kget] [Bug 88820] no confirmation for deleting downloads

Urs Wolfer u.wolfer at bluewin.ch
Wed Jul 27 13:24:43 CEST 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=88820         
u.wolfer bluewin ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From u.wolfer bluewin ch  2005-07-27 13:24 -------
SVN commit 439190 by uwolfer:

BUG: 88820
Confirmation dialog for delete files from individual window.

 M  +23 -16    transfer.cpp  


--- trunk/KDE/kdenetwork/kget/transfer.cpp #439189:439190
 @ -33,6 +33,7  @
 #include <kiconloader.h>
 #include <kstandarddirs.h>
 #include <kwin.h>
+#include <kmessagebox.h>
 
 #include <assert.h>
 #include "safedelete.h"
 @ -451,27 +452,33  @
 void Transfer::slotRequestRemove()
 {
     sDebugIn << endl;
-    m_paDelete->setEnabled(false);
-    m_paPause->setEnabled(false);
-    if(dlgIndividual)
-                dlgIndividual->close();
+    if (KMessageBox::warningContinueCancel(0, i18n("Are you sure you want to delete this transfer?"),
+                                           i18n("Question"), KStdGuiItem::del(),
+                                           QString("delete_transfer"))
+        == KMessageBox::Continue)
+    {
+        m_paDelete->setEnabled(false);
+        m_paPause->setEnabled(false);
+        if(dlgIndividual)
+                    dlgIndividual->close();
 
 
-    if ( status != ST_FINISHED )
-    {
-        KURL file = dest;
-        // delete the partly downloaded file, if any
-        file.setFileName( dest.fileName() + ".part" ); // ### get it from the job?
+        if ( status != ST_FINISHED )
+        {
+            KURL file = dest;
+            // delete the partly downloaded file, if any
+            file.setFileName( dest.fileName() + ".part" ); // ### get it from the job?
   
-        if ( KIO::NetAccess::exists( file, false, view ) ) // don't pollute user with warnings
-        {
-            SafeDelete::deleteFile( file ); // ### messagebox on failure?
+            if ( KIO::NetAccess::exists( file, false, view ) ) // don't pollute user with warnings
+            {
+                SafeDelete::deleteFile( file ); // ### messagebox on failure?
+            }
         }
+        if (status == ST_RUNNING)
+            m_pSlave->Op(Slave::REMOVE);
+        else
+            emit statusChanged(this, OP_REMOVED);
     }
-    if (status == ST_RUNNING)
-        m_pSlave->Op(Slave::REMOVE);
-    else
-        emit statusChanged(this, OP_REMOVED);
 
     sDebugOut << endl;
 }



More information about the Kget mailing list