~ubuntu-branches/ubuntu/lucid/firefox/lucid

« back to all changes in this revision

Viewing changes to debian/patches/add_syspref_dir.patch

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Alexander Sack, Micah Gersten, Jamie Strandboge
  • Date: 2010-02-17 21:48:12 UTC
  • Revision ID: james.westby@ubuntu.com-20100217214812-ufut8l5qy34fql20
Tags: 3.6+nobinonly-0ubuntu3
[ Alexander Sack <asac@ubuntu.com> ]
* fix LP: #520963 - sysprefs not honoured since firefox is built without
  system xulrunner; resurrect the patch we ship in xulrunner
  - add debian/patches/add_syspref_dir.patch
  - update debian/patches/series
* fix LP: #520682 - Only search provider is Ask.com; set en-US as
  distribution.searchplugins.defaultLocale in syspref firefox.js
  - update debian/firefox.js
* fix LP: #428306 - default search engines are removed and readded (keywords
  wiped) with upgrade
  - add debian/patches/bz534663_attXXX_normalize_distribution_searchplugins.patch
  - update debian/patches/series
* add ubuntu fr code for yahoo (en-US) searchplugin
  - add debian/patches/ubuntu_codes_yahoo.patch
  - update debian/patches/series

[ Micah Gersten <micahg@ubuntu.com> ]
* Rename apport hook to firefox.py (unversioned)
  - rename debian/apport/firefox-3.6.py => debian/apport/firefox.py
* Update apport hook to pull from unversioned profile directory
* Update apport hook to report on non-distro package and tag PPA
* Collect version info for firefox/abrowser packages
  - update debian/apport/firefox.py
* Install apport hook again
  - update debian/firefox.install

[ Jamie Strandboge <jamie@ubuntu.com> ]
* debian/firefox.postinst.in: move aside the old firefox-3.5 AppArmor
  profile

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
---
 
2
 modules/libpref/src/nsPrefService.cpp  |    8 ++++++++
 
3
 toolkit/xre/nsXREDirProvider.cpp       |    4 ++++
 
4
 xpcom/io/nsAppDirectoryServiceDefs.h   |    1 +
 
5
 xpcom/io/nsAppFileLocationProvider.cpp |   10 ++++++++++
 
6
 4 files changed, 23 insertions(+)
 
7
 
 
8
Index: mozilla/toolkit/xre/nsXREDirProvider.cpp
 
9
===================================================================
 
10
--- mozilla.orig/toolkit/xre/nsXREDirProvider.cpp
 
11
+++ mozilla/toolkit/xre/nsXREDirProvider.cpp
 
12
@@ -619,16 +619,17 @@
 
13
   nsCOMPtr<nsIFile> subdir;
 
14
   while (NS_SUCCEEDED(files->GetNextFile(getter_AddRefs(subdir))) && subdir) {
 
15
     mAppBundleDirectories.AppendObject(subdir);
 
16
     LoadPlatformDirectory(subdir, mAppBundleDirectories);
 
17
   }
 
18
 }
 
19
 
 
20
 static const char *const kAppendPrefDir[] = { "defaults", "preferences", nsnull };
 
21
+static const char *const kAppendSysPrefDir[] = { "defaults", "syspref", nsnull };
 
22
 
 
23
 #ifdef DEBUG_bsmedberg
 
24
 static void
 
25
 DumpFileArray(const char *key,
 
26
               nsCOMArray<nsIFile> dirs)
 
27
 {
 
28
   fprintf(stderr, "nsXREDirProvider::GetFilesInternal(%s)\n", key);
 
29
 
 
30
@@ -675,16 +676,19 @@
 
31
   else if (!strcmp(aProperty, NS_APP_PREFS_DEFAULTS_DIR_LIST)) {
 
32
     nsCOMArray<nsIFile> directories;
 
33
 
 
34
     LoadBundleDirectories();
 
35
 
 
36
     LoadAppDirIntoArray(mXULAppDir, kAppendPrefDir, directories);
 
37
     LoadDirsIntoArray(mAppBundleDirectories,
 
38
                       kAppendPrefDir, directories);
 
39
+    LoadAppDirIntoArray(mXULAppDir, kAppendSysPrefDir, directories);
 
40
+    LoadDirsIntoArray(mAppBundleDirectories,
 
41
+                      kAppendSysPrefDir, directories);
 
42
 
 
43
     rv = NS_NewArrayEnumerator(aResult, directories);
 
44
   }
 
45
   else if (!strcmp(aProperty, NS_EXT_PREFS_DEFAULTS_DIR_LIST)) {
 
46
     nsCOMArray<nsIFile> directories;
 
47
 
 
48
     LoadBundleDirectories();
 
49
     LoadDirsIntoArray(mExtensionDirectories,
 
50
Index: mozilla/modules/libpref/src/nsPrefService.cpp
 
51
===================================================================
 
52
--- mozilla.orig/modules/libpref/src/nsPrefService.cpp
 
53
+++ mozilla/modules/libpref/src/nsPrefService.cpp
 
54
@@ -818,16 +818,24 @@
 
55
 #endif
 
56
   };
 
57
 
 
58
   rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
 
59
   if (NS_FAILED(rv)) {
 
60
     NS_WARNING("Error parsing application default preferences.");
 
61
   }
 
62
 
 
63
+  /* now, parse the "application" default system preferences */
 
64
+  rv = NS_GetSpecialDirectory(NS_APP_SYSPREF_DEFAULTS_50_DIR, getter_AddRefs(defaultPrefDir));
 
65
+  NS_ENSURE_SUCCESS(rv, rv);
 
66
+  rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
 
67
+  if (NS_FAILED(rv)) {
 
68
+    NS_WARNING("Error parsing application default preferences.");
 
69
+  }
 
70
+
 
71
   rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST);
 
72
   NS_ENSURE_SUCCESS(rv, rv);
 
73
 
 
74
   NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID,
 
75
                                 nsnull, NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID);
 
76
 
 
77
   nsCOMPtr<nsIObserverService> observerService = 
 
78
     do_GetService("@mozilla.org/observer-service;1", &rv);
 
79
Index: mozilla/xpcom/io/nsAppDirectoryServiceDefs.h
 
80
===================================================================
 
81
--- mozilla.orig/xpcom/io/nsAppDirectoryServiceDefs.h
 
82
+++ mozilla/xpcom/io/nsAppDirectoryServiceDefs.h
 
83
@@ -58,16 +58,17 @@
 
84
 // Files and directories which exist on a per-product basis
 
85
 // --------------------------------------------------------------------------------------
 
86
 
 
87
 #define NS_APP_APPLICATION_REGISTRY_FILE        "AppRegF"
 
88
 #define NS_APP_APPLICATION_REGISTRY_DIR         "AppRegD"
 
89
 
 
90
 #define NS_APP_DEFAULTS_50_DIR                  "DefRt"         // The root dir of all defaults dirs
 
91
 #define NS_APP_PREF_DEFAULTS_50_DIR             "PrfDef"
 
92
+#define NS_APP_SYSPREF_DEFAULTS_50_DIR          "SysPrfDef"
 
93
 #define NS_APP_PROFILE_DEFAULTS_50_DIR          "profDef"       // The profile defaults of the "current"
 
94
                                                                 // locale. Should be first choice.
 
95
 #define NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR     "ProfDefNoLoc"  // The profile defaults of the "default"
 
96
                                                                 // installed locale. Second choice
 
97
                                                                 // when above is not available.
 
98
                                                                                                                        
 
99
 #define NS_APP_USER_PROFILES_ROOT_DIR           "DefProfRt"     // The dir where user profile dirs live.
 
100
 #define NS_APP_USER_PROFILES_LOCAL_ROOT_DIR     "DefProfLRt"  // The dir where user profile temp dirs live.
 
101
Index: mozilla/xpcom/io/nsAppFileLocationProvider.cpp
 
102
===================================================================
 
103
--- mozilla.orig/xpcom/io/nsAppFileLocationProvider.cpp
 
104
+++ mozilla/xpcom/io/nsAppFileLocationProvider.cpp
 
105
@@ -96,16 +96,17 @@
 
106
 #define NS_MACOSX_LOCAL_PLUGIN_DIR  "OSXLocalPlugins"
 
107
 #define NS_MAC_CLASSIC_PLUGIN_DIR   "MacSysPlugins"
 
108
 #elif XP_UNIX
 
109
 #define NS_SYSTEM_PLUGINS_DIR       "SysPlugins"
 
110
 #endif
 
111
 
 
112
 #define DEFAULTS_DIR_NAME           NS_LITERAL_CSTRING("defaults")
 
113
 #define DEFAULTS_PREF_DIR_NAME      NS_LITERAL_CSTRING("pref")
 
114
+#define DEFAULTS_SYSPREF_DIR_NAME   NS_LITERAL_CSTRING("syspref")
 
115
 #define DEFAULTS_PROFILE_DIR_NAME   NS_LITERAL_CSTRING("profile")
 
116
 #define RES_DIR_NAME                NS_LITERAL_CSTRING("res")
 
117
 #define CHROME_DIR_NAME             NS_LITERAL_CSTRING("chrome")
 
118
 #define PLUGINS_DIR_NAME            NS_LITERAL_CSTRING("plugins")
 
119
 #define SEARCH_DIR_NAME             NS_LITERAL_CSTRING("searchplugins")
 
120
 
 
121
 //*****************************************************************************
 
122
 // nsAppFileLocationProvider::Constructor/Destructor
 
123
@@ -162,16 +163,25 @@
 
124
     {
 
125
         rv = CloneMozBinDirectory(getter_AddRefs(localFile));
 
126
         if (NS_SUCCEEDED(rv)) {
 
127
             rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
 
128
             if (NS_SUCCEEDED(rv))
 
129
                 rv = localFile->AppendRelativeNativePath(DEFAULTS_PREF_DIR_NAME);
 
130
         }
 
131
     }
 
132
+    else if (nsCRT::strcmp(prop, NS_APP_SYSPREF_DEFAULTS_50_DIR) == 0)
 
133
+    {
 
134
+        rv = CloneMozBinDirectory(getter_AddRefs(localFile));
 
135
+        if (NS_SUCCEEDED(rv)) {
 
136
+            rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
 
137
+            if (NS_SUCCEEDED(rv))
 
138
+                rv = localFile->AppendRelativeNativePath(DEFAULTS_SYSPREF_DIR_NAME);
 
139
+        }
 
140
+    }
 
141
     else if (nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0 ||
 
142
              nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0)
 
143
     {
 
144
         rv = CloneMozBinDirectory(getter_AddRefs(localFile));
 
145
         if (NS_SUCCEEDED(rv)) {
 
146
             rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
 
147
             if (NS_SUCCEEDED(rv))
 
148
                 rv = localFile->AppendRelativeNativePath(DEFAULTS_PROFILE_DIR_NAME);