diff options
Diffstat (limited to 'meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch')
-rw-r--r-- | meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch new file mode 100644 index 0000000..940eac7 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Fri, 30 Mar 2012 15:44:54 +0200 | ||
3 | Subject: Load distribution search plugins from /etc/<appname>/searchplugins | ||
4 | |||
5 | --- | ||
6 | .../components/dirprovider/DirectoryProvider.cpp | 22 ++++++++++++++------ | ||
7 | 1 file changed, 16 insertions(+), 6 deletions(-) | ||
8 | |||
9 | diff --git a/browser/components/dirprovider/DirectoryProvider.cpp b/browser/components/dirprovider/DirectoryProvider.cpp | ||
10 | index 1373adc..cde4587 100644 | ||
11 | --- a/browser/components/dirprovider/DirectoryProvider.cpp | ||
12 | +++ b/browser/components/dirprovider/DirectoryProvider.cpp | ||
13 | @@ -38,7 +38,8 @@ | ||
14 | #include "nsIDirectoryService.h" | ||
15 | #include "DirectoryProvider.h" | ||
16 | |||
17 | -#include "nsIFile.h" | ||
18 | +#include "nsIXULAppInfo.h" | ||
19 | +#include "nsILocalFile.h" | ||
20 | #include "nsISimpleEnumerator.h" | ||
21 | #include "nsIPrefService.h" | ||
22 | #include "nsIPrefBranch.h" | ||
23 | @@ -166,13 +167,22 @@ AppendFileKey(const char *key, nsIProperties* aDirSvc, | ||
24 | static void | ||
25 | AppendDistroSearchDirs(nsIProperties* aDirSvc, nsCOMArray<nsIFile> &array) | ||
26 | { | ||
27 | - nsCOMPtr<nsIFile> searchPlugins; | ||
28 | - nsresult rv = aDirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, | ||
29 | - NS_GET_IID(nsIFile), | ||
30 | - getter_AddRefs(searchPlugins)); | ||
31 | + nsCOMPtr<nsILocalFile> searchPlugins; | ||
32 | + nsresult rv = NS_NewLocalFile(NS_LITERAL_STRING("/etc"), false, | ||
33 | + getter_AddRefs(searchPlugins)); | ||
34 | if (NS_FAILED(rv)) | ||
35 | return; | ||
36 | - searchPlugins->AppendNative(NS_LITERAL_CSTRING("distribution")); | ||
37 | + nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1"); | ||
38 | + if (!appInfo) | ||
39 | + return; | ||
40 | + | ||
41 | + nsCAutoString name; | ||
42 | + rv = appInfo->GetName(name); | ||
43 | + if (NS_FAILED(rv)) | ||
44 | + return; | ||
45 | + ToLowerCase(name); | ||
46 | + | ||
47 | + searchPlugins->AppendNative(name); | ||
48 | searchPlugins->AppendNative(NS_LITERAL_CSTRING("searchplugins")); | ||
49 | |||
50 | bool exists; | ||