Bug 664832 - Page info should use the same last dir for both single and multiple file saves r=neil a=callek
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 11 Sep 2011 22:59:30 +0100
changeset 8448 e2962b868add51a419607dc6ea5f7d9896fe4c1e
parent 8447 d3ced72c9a7c3d9a5f8c58e2c5a6ee25b513dab7
child 8452 e40f9a5e8de125ea320e1fe6bcaee50bfd0f24d0
push id122
push useriann_cvs@blueyonder.co.uk
push dateSun, 11 Sep 2011 21:59:42 +0000
treeherdercomm-beta@e2962b868add [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, callek
bugs664832
Bug 664832 - Page info should use the same last dir for both single and multiple file saves r=neil a=callek
suite/browser/pageinfo/pageInfo.js
--- a/suite/browser/pageinfo/pageInfo.js
+++ b/suite/browser/pageinfo/pageInfo.js
@@ -798,19 +798,23 @@ function selectSaveFolder()
 {
   const nsILocalFile = Components.interfaces.nsILocalFile;
   const nsIFilePicker = Components.interfaces.nsIFilePicker;
   var fp = Components.classes["@mozilla.org/filepicker;1"]
                      .createInstance(nsIFilePicker);
 
   var titleText = gBundle.getString("mediaSelectFolder");
   fp.init(window, titleText, nsIFilePicker.modeGetFolder);
-  var initialDir = GetLocalFilePref("browser.download.dir");
-  if (initialDir)
-    fp.displayDirectory = initialDir;
+  var initialDir = GetLocalFilePref("browser.download.lastDir");
+  if (!initialDir) {
+    let dnldMgr = Components.classes["@mozilla.org/download-manager;1"]
+                            .getService(Components.interfaces.nsIDownloadManager);
+    initialDir = dnldMgr.userDownloadsDirectory;
+  }
+  fp.displayDirectory = initialDir;
 
   fp.appendFilters(nsIFilePicker.filterAll);
   var ret = fp.show();
 
   if (ret == nsIFilePicker.returnOK)
     return fp.file.QueryInterface(nsILocalFile);
   return null;
 }