Bug 582239 - Add 'delete file' function to download manager [r=mfinkle]
authorWesley Johnston <wjohnston@mozilla.com>
Fri, 10 Sep 2010 23:45:52 -0400
changeset 66565 635caced437c8832f43414ff9b79ea2cf9720e62
parent 66564 791f5b7ee42fa8b6b34e19c8cd98d793b92325db
child 66566 df470131c89c4760ff34a3ef6d65c453ad3e9050
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs582239
Bug 582239 - Add 'delete file' function to download manager [r=mfinkle]
mobile/chrome/content/downloads.js
--- a/mobile/chrome/content/downloads.js
+++ b/mobile/chrome/content/downloads.js
@@ -365,21 +365,24 @@ var DownloadsView = {
       f.launch();
     } catch (ex) { }
 
     // TODO: add back the code for "dontAsk"?
   },
 
   removeDownload: function dv_removeDownload(aItem) {
     this._dlmgr.removeDownload(aItem.getAttribute("downloadID"));
+    let f = this._getLocalFile(aItem.getAttribute("file"));
+    if (f.exists())
+      f.remove(false);
   },
 
   cancelDownload: function dv_cancelDownload(aItem) {
     this._dlmgr.cancelDownload(aItem.getAttribute("downloadID"));
-    var f = this._getLocalFile(aItem.getAttribute("file"));
+    let f = this._getLocalFile(aItem.getAttribute("file"));
     if (f.exists())
       f.remove(false);
   },
 
   pauseDownload: function dv_pauseDownload(aItem) {
     this._dlmgr.pauseDownload(aItem.getAttribute("downloadID"));
   },