LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File toolkit-download-folder.patch of Package xulrunner (Project mozilla:Factory)

From: Wolfgang Rosenauer
Subject: Don't use localized Downloads unless XDG is set up
References:
https://bugzilla.novell.com/show_bug.cgi?id=501724

diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -290,17 +290,17 @@ var gMainPane = {
       // and was available as an option in the 1.5 drop down. On XP this
       // was in My Documents, on OSX it was in User Docs. In 2.0, we did
       // away with the drop down option, although the special label was
       // still supported for the folder if it existed. Because it was
       // not exposed it was rarely used.
       // With 3.0, a new desktop folder - 'Downloads' was introduced for
       // platforms and versions that don't support a default system downloads
       // folder. See nsDownloadManager for details. 
-      downloadFolder.label = bundlePreferences.getString("downloadsFolderName");
+      downloadFolder.label = "Downloads";
       iconUrlSpec = fph.getURLSpecFromFile(this._indexToFolder(1));
     } else {
       // 'Desktop'
       downloadFolder.label = bundlePreferences.getString("desktopFolderName");
       iconUrlSpec = fph.getURLSpecFromFile(this._getDownloadsFolder("Desktop"));
     }
     downloadFolder.image = "moz-icon://" + iconUrlSpec + "?size=16";
     
diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -1365,18 +1365,20 @@ nsDownloadManager::GetDefaultDownloadsDi
   // Vista:
   // Downloads
   // XP/2K:
   // My Documents/Downloads
   // Linux:
   // XDG user dir spec, with a fallback to Home/Downloads
 
   nsXPIDLString folderName;
-  mBundle->GetStringFromName(MOZ_UTF16("downloadsFolder"),
-                             getter_Copies(folderName));
+  // We don't want localized "Downloads" unless XDG is used
+  //mBundle->GetStringFromName(NS_LITERAL_STRING("downloadsFolder").get(),
+  //                           getter_Copies(folderName));
+  folderName.AssignLiteral("Downloads");
 
 #if defined (XP_MACOSX)
   rv = dirService->Get(NS_OSX_DEFAULT_DOWNLOAD_DIR,
                        NS_GET_IID(nsIFile),
                        getter_AddRefs(downloadDir));
   NS_ENSURE_SUCCESS(rv, rv);
 #elif defined(XP_WIN)
   rv = dirService->Get(NS_WIN_DEFAULT_DOWNLOAD_DIR,