Bug 88820 - no confirmation for deleting downloads
Summary: no confirmation for deleting downloads
Status: RESOLVED FIXED
Alias: None
Product: kget
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KGet authors
URL:
Keywords:
: 93576 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-04 12:56 UTC by Daniel Link
Modified: 2005-07-27 13:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Link 2004-09-04 12:56:13 UTC
Version:           v0.8.3 (using KDE 3.2 BRANCH >= 20040204, Mandrake Linux Cooker i586 - Cooker)
Compiler:          gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
OS:                Linux (i686) release 2.6.3-7mdk

i just deleted two almost complete and very large downloads by accidently clicking the trash can icon. ARGH!!! a confirmation dialog would be nice. because this isn't just a feature but a MUST i consider this a bug report.
Comment 1 Stephan Binner 2004-12-02 12:37:40 UTC
*** Bug 93576 has been marked as a duplicate of this bug. ***
Comment 2 Urs Wolfer 2005-07-27 13:24:39 UTC
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;
 }