1
Description: Add support for localized distribution searchplugins
2
Author: Alexander Sack <asac@ubuntu.com>
3
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=515232
4
Forwarded: https://bugzilla.mozilla.org/attachment.cgi?id=399338
6
Index: mozilla/browser/components/dirprovider/DirectoryProvider.cpp
7
===================================================================
8
--- mozilla.orig/browser/components/dirprovider/DirectoryProvider.cpp 2012-03-07 19:47:01.707413688 +0000
9
+++ mozilla/browser/components/dirprovider/DirectoryProvider.cpp 2012-03-07 19:56:03.147404067 +0000
12
* ***** END LICENSE BLOCK ***** */
14
+#include "nsIChromeRegistry.h"
15
#include "nsIDirectoryService.h"
16
#include "DirectoryProvider.h"
19
array.AppendObject(commonPlugins);
22
- nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
25
- nsCOMPtr<nsIFile> localePlugins;
26
- rv = searchPlugins->Clone(getter_AddRefs(localePlugins));
29
+ nsCOMPtr<nsIFile> localePlugins;
30
+ rv = searchPlugins->Clone(getter_AddRefs(localePlugins));
34
- localePlugins->AppendNative(NS_LITERAL_CSTRING("locale"));
35
+ localePlugins->AppendNative(NS_LITERAL_CSTRING("locale"));
38
- rv = prefs->GetCharPref("general.useragent.locale", getter_Copies(locale));
39
+ nsCOMPtr<nsIXULChromeRegistry> chromeReg(do_GetService(NS_CHROMEREGISTRY_CONTRACTID));
41
+ nsCAutoString locale;
42
+ chromeReg->GetSelectedLocale(NS_LITERAL_CSTRING("global"), locale);
43
if (NS_SUCCEEDED(rv)) {
45
nsCOMPtr<nsIFile> curLocalePlugins;
47
array.AppendObject(curLocalePlugins);
55
+ nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
57
// we didn't append the locale dir - try the default one
59
rv = prefs->GetCharPref("distribution.searchplugins.defaultLocale",