1 diff --git a/chrome/src/Makefile.in b/chrome/src/Makefile.in |
|
2 --- a/chrome/src/Makefile.in |
|
3 +++ b/chrome/src/Makefile.in |
|
4 @@ -81,16 +81,17 @@ CPPSRCS = \ |
|
5 |
|
6 EXTRA_DSO_LDOPTS = \ |
|
7 $(MOZ_UNICHARUTIL_LIBS) \ |
|
8 $(MOZ_COMPONENT_LIBS) \ |
|
9 $(NULL) |
|
10 |
|
11 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) |
|
12 EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) |
|
13 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre |
|
14 endif |
|
15 |
|
16 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
|
17 EXTRA_DSO_LDOPTS += $(TK_LIBS) |
|
18 endif |
|
19 |
|
20 include $(topsrcdir)/config/rules.mk |
|
21 |
|
22 diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp |
|
23 --- a/chrome/src/nsChromeRegistry.cpp |
|
24 +++ b/chrome/src/nsChromeRegistry.cpp |
|
25 @@ -109,16 +109,17 @@ |
|
26 #include "nsIStyleSheet.h" |
|
27 #include "nsISupportsArray.h" |
|
28 #include "nsIVersionComparator.h" |
|
29 #include "nsIWindowMediator.h" |
|
30 #include "nsIXPConnect.h" |
|
31 #include "nsIXULAppInfo.h" |
|
32 #include "nsIXULRuntime.h" |
|
33 #include "nsPresShellIterator.h" |
|
34 +#include "nsKDEUtils.h" |
|
35 |
|
36 #define UILOCALE_CMD_LINE_ARG "UILocale" |
|
37 |
|
38 #define MATCH_OS_LOCALE_PREF "intl.locale.matchOS" |
|
39 #define SELECTED_LOCALE_PREF "general.useragent.locale" |
|
40 #define SELECTED_SKIN_PREF "general.skins.selectedSkin" |
|
41 |
|
42 static NS_DEFINE_CID(kCSSLoaderCID, NS_CSS_LOADER_CID); |
|
43 @@ -1608,16 +1609,17 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
44 |
|
45 NS_NAMED_LITERAL_STRING(kPlatform, "platform"); |
|
46 NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers"); |
|
47 NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible"); |
|
48 NS_NAMED_LITERAL_STRING(kApplication, "application"); |
|
49 NS_NAMED_LITERAL_STRING(kAppVersion, "appversion"); |
|
50 NS_NAMED_LITERAL_STRING(kOs, "os"); |
|
51 NS_NAMED_LITERAL_STRING(kOsVersion, "osversion"); |
|
52 + NS_NAMED_LITERAL_STRING(kDesktop, "desktop"); |
|
53 |
|
54 nsCOMPtr<nsIIOService> io (do_GetIOService()); |
|
55 if (!io) return NS_ERROR_FAILURE; |
|
56 |
|
57 nsCOMPtr<nsIProtocolHandler> ph; |
|
58 rv = io->GetProtocolHandler("resource", getter_AddRefs(ph)); |
|
59 NS_ENSURE_SUCCESS(rv, rv); |
|
60 |
|
61 @@ -1651,35 +1653,39 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
62 if (NS_SUCCEEDED(rv)) { |
|
63 CopyUTF8toUTF16(s, osTarget); |
|
64 ToLowerCase(osTarget); |
|
65 } |
|
66 } |
|
67 } |
|
68 |
|
69 nsAutoString osVersion; |
|
70 + nsAutoString desktop; |
|
71 #if defined(XP_WIN) |
|
72 OSVERSIONINFO info = { sizeof(OSVERSIONINFO) }; |
|
73 if (GetVersionEx(&info)) { |
|
74 nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
|
75 info.dwMajorVersion, |
|
76 info.dwMinorVersion); |
|
77 } |
|
78 + desktop = NS_LITERAL_STRING("win"); |
|
79 #elif defined(XP_MACOSX) |
|
80 long majorVersion, minorVersion; |
|
81 if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) && |
|
82 (Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr)) { |
|
83 nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
|
84 majorVersion, |
|
85 minorVersion); |
|
86 } |
|
87 + desktop = NS_LITERAL_STRING("macosx"); |
|
88 #elif defined(MOZ_WIDGET_GTK2) |
|
89 nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
|
90 gtk_major_version, |
|
91 gtk_minor_version); |
|
92 + desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome"); // TODO others? |
|
93 #endif |
|
94 |
|
95 char *token; |
|
96 char *newline = buf; |
|
97 PRUint32 line = 0; |
|
98 |
|
99 // outer loop tokenizes by newline |
|
100 while (nsnull != (token = nsCRT::strtok(newline, kNewlines, &newline))) { |
|
101 @@ -1713,41 +1719,43 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
102 |
|
103 PRBool platform = PR_FALSE; |
|
104 PRBool xpcNativeWrappers = PR_TRUE; |
|
105 PRBool contentAccessible = PR_FALSE; |
|
106 TriState stAppVersion = eUnspecified; |
|
107 TriState stApp = eUnspecified; |
|
108 TriState stOsVersion = eUnspecified; |
|
109 TriState stOs = eUnspecified; |
|
110 + TriState stDesktop = eUnspecified; |
|
111 |
|
112 PRBool badFlag = PR_FALSE; |
|
113 |
|
114 while (nsnull != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
|
115 !badFlag) { |
|
116 NS_ConvertASCIItoUTF16 wtoken(token); |
|
117 ToLowerCase(wtoken); |
|
118 |
|
119 if (CheckFlag(kPlatform, wtoken, platform) || |
|
120 CheckFlag(kXPCNativeWrappers, wtoken, xpcNativeWrappers) || |
|
121 CheckFlag(kContentAccessible, wtoken, contentAccessible) || |
|
122 CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
123 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
124 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
125 CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
|
126 CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
|
127 continue; |
|
128 |
|
129 LogMessageWithContext(manifestURI, line, nsIScriptError::warningFlag, |
|
130 "Warning: Unrecognized chrome registration modifier '%s'.", |
|
131 token); |
|
132 badFlag = PR_TRUE; |
|
133 } |
|
134 |
|
135 if (badFlag || stApp == eBad || stAppVersion == eBad || |
|
136 - stOs == eBad || stOsVersion == eBad) |
|
137 + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
|
138 continue; |
|
139 |
|
140 nsCOMPtr<nsIURI> resolved; |
|
141 rv = io->NewURI(nsDependentCString(uri), nsnull, manifestURI, |
|
142 getter_AddRefs(resolved)); |
|
143 if (NS_FAILED(rv)) |
|
144 continue; |
|
145 |
|
146 @@ -1798,38 +1806,40 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
147 } |
|
148 |
|
149 EnsureLowerCase(package); |
|
150 |
|
151 TriState stAppVersion = eUnspecified; |
|
152 TriState stApp = eUnspecified; |
|
153 TriState stOs = eUnspecified; |
|
154 TriState stOsVersion = eUnspecified; |
|
155 + TriState stDesktop = eUnspecified; |
|
156 |
|
157 PRBool badFlag = PR_FALSE; |
|
158 |
|
159 while (nsnull != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
|
160 !badFlag) { |
|
161 NS_ConvertASCIItoUTF16 wtoken(token); |
|
162 ToLowerCase(wtoken); |
|
163 |
|
164 if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
165 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
166 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
167 CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
|
168 CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
|
169 continue; |
|
170 |
|
171 LogMessageWithContext(manifestURI, line, nsIScriptError::warningFlag, |
|
172 "Warning: Unrecognized chrome registration modifier '%s'.", |
|
173 token); |
|
174 badFlag = PR_TRUE; |
|
175 } |
|
176 |
|
177 if (badFlag || stApp == eBad || stAppVersion == eBad || |
|
178 - stOs == eBad || stOsVersion == eBad) |
|
179 + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
|
180 continue; |
|
181 |
|
182 nsCOMPtr<nsIURI> resolved; |
|
183 rv = io->NewURI(nsDependentCString(uri), nsnull, manifestURI, |
|
184 getter_AddRefs(resolved)); |
|
185 if (NS_FAILED(rv)) |
|
186 continue; |
|
187 |
|
188 @@ -1860,38 +1870,40 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
189 } |
|
190 |
|
191 EnsureLowerCase(package); |
|
192 |
|
193 TriState stAppVersion = eUnspecified; |
|
194 TriState stApp = eUnspecified; |
|
195 TriState stOs = eUnspecified; |
|
196 TriState stOsVersion = eUnspecified; |
|
197 + TriState stDesktop = eUnspecified; |
|
198 |
|
199 PRBool badFlag = PR_FALSE; |
|
200 |
|
201 while (nsnull != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
|
202 !badFlag) { |
|
203 NS_ConvertASCIItoUTF16 wtoken(token); |
|
204 ToLowerCase(wtoken); |
|
205 |
|
206 if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
207 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
208 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
209 CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
|
210 CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
|
211 continue; |
|
212 |
|
213 LogMessageWithContext(manifestURI, line, nsIScriptError::warningFlag, |
|
214 "Warning: Unrecognized chrome registration modifier '%s'.", |
|
215 token); |
|
216 badFlag = PR_TRUE; |
|
217 } |
|
218 |
|
219 if (badFlag || stApp == eBad || stAppVersion == eBad || |
|
220 - stOs == eBad || stOsVersion == eBad) |
|
221 + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
|
222 continue; |
|
223 |
|
224 nsCOMPtr<nsIURI> resolved; |
|
225 rv = io->NewURI(nsDependentCString(uri), nsnull, manifestURI, |
|
226 getter_AddRefs(resolved)); |
|
227 if (NS_FAILED(rv)) |
|
228 continue; |
|
229 |
|
230 @@ -1924,38 +1936,40 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
231 "Warning: malformed chrome overlay instruction."); |
|
232 continue; |
|
233 } |
|
234 |
|
235 TriState stAppVersion = eUnspecified; |
|
236 TriState stApp = eUnspecified; |
|
237 TriState stOs = eUnspecified; |
|
238 TriState stOsVersion = eUnspecified; |
|
239 + TriState stDesktop = eUnspecified; |
|
240 |
|
241 PRBool badFlag = PR_FALSE; |
|
242 |
|
243 while (nsnull != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
|
244 !badFlag) { |
|
245 NS_ConvertASCIItoUTF16 wtoken(token); |
|
246 ToLowerCase(wtoken); |
|
247 |
|
248 if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
249 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
250 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
251 CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
|
252 CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
|
253 continue; |
|
254 |
|
255 LogMessageWithContext(manifestURI, line, nsIScriptError::warningFlag, |
|
256 "Warning: Unrecognized chrome registration modifier '%s'.", |
|
257 token); |
|
258 badFlag = PR_TRUE; |
|
259 } |
|
260 |
|
261 if (badFlag || stApp == eBad || stAppVersion == eBad || |
|
262 - stOs == eBad || stOsVersion == eBad) |
|
263 + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
|
264 continue; |
|
265 |
|
266 nsCOMPtr<nsIURI> baseuri, overlayuri; |
|
267 rv = io->NewURI(nsDependentCString(base), nsnull, nsnull, |
|
268 getter_AddRefs(baseuri)); |
|
269 rv |= io->NewURI(nsDependentCString(overlay), nsnull, nsnull, |
|
270 getter_AddRefs(overlayuri)); |
|
271 if (NS_FAILED(rv)) { |
|
272 @@ -1980,38 +1994,40 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
273 "Warning: malformed chrome style instruction."); |
|
274 continue; |
|
275 } |
|
276 |
|
277 TriState stAppVersion = eUnspecified; |
|
278 TriState stApp = eUnspecified; |
|
279 TriState stOs = eUnspecified; |
|
280 TriState stOsVersion = eUnspecified; |
|
281 + TriState stDesktop = eUnspecified; |
|
282 |
|
283 PRBool badFlag = PR_FALSE; |
|
284 |
|
285 while (nsnull != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
|
286 !badFlag) { |
|
287 NS_ConvertASCIItoUTF16 wtoken(token); |
|
288 ToLowerCase(wtoken); |
|
289 |
|
290 if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
291 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
292 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
293 CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
|
294 CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
|
295 continue; |
|
296 |
|
297 LogMessageWithContext(manifestURI, line, nsIScriptError::warningFlag, |
|
298 "Warning: Unrecognized chrome registration modifier '%s'.", |
|
299 token); |
|
300 badFlag = PR_TRUE; |
|
301 } |
|
302 |
|
303 if (badFlag || stApp == eBad || stAppVersion == eBad || |
|
304 - stOs == eBad || stOsVersion == eBad) |
|
305 + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
|
306 continue; |
|
307 |
|
308 nsCOMPtr<nsIURI> baseuri, overlayuri; |
|
309 rv = io->NewURI(nsDependentCString(base), nsnull, nsnull, |
|
310 getter_AddRefs(baseuri)); |
|
311 rv |= io->NewURI(nsDependentCString(overlay), nsnull, nsnull, |
|
312 getter_AddRefs(overlayuri)); |
|
313 if (NS_FAILED(rv)) |
|
314 @@ -2040,38 +2056,40 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
315 "Warning: malformed chrome override instruction."); |
|
316 continue; |
|
317 } |
|
318 |
|
319 TriState stAppVersion = eUnspecified; |
|
320 TriState stApp = eUnspecified; |
|
321 TriState stOs = eUnspecified; |
|
322 TriState stOsVersion = eUnspecified; |
|
323 + TriState stDesktop = eUnspecified; |
|
324 |
|
325 PRBool badFlag = PR_FALSE; |
|
326 |
|
327 while (nsnull != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
|
328 !badFlag) { |
|
329 NS_ConvertASCIItoUTF16 wtoken(token); |
|
330 ToLowerCase(wtoken); |
|
331 |
|
332 if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
333 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
334 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
335 CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
|
336 CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
|
337 continue; |
|
338 |
|
339 LogMessageWithContext(manifestURI, line, nsIScriptError::warningFlag, |
|
340 "Warning: Unrecognized chrome registration modifier '%s'.", |
|
341 token); |
|
342 badFlag = PR_TRUE; |
|
343 } |
|
344 |
|
345 if (badFlag || stApp == eBad || stAppVersion == eBad || |
|
346 - stOs == eBad || stOsVersion == eBad) |
|
347 + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
|
348 continue; |
|
349 |
|
350 nsCOMPtr<nsIURI> chromeuri, resolveduri; |
|
351 rv = io->NewURI(nsDependentCString(chrome), nsnull, nsnull, |
|
352 getter_AddRefs(chromeuri)); |
|
353 rv |= io->NewURI(nsDependentCString(resolved), nsnull, manifestURI, |
|
354 getter_AddRefs(resolveduri)); |
|
355 if (NS_FAILED(rv)) |
|
356 @@ -2102,38 +2120,40 @@ nsChromeRegistry::ProcessManifestBuffer( |
|
357 } |
|
358 |
|
359 EnsureLowerCase(package); |
|
360 |
|
361 TriState stAppVersion = eUnspecified; |
|
362 TriState stApp = eUnspecified; |
|
363 TriState stOsVersion = eUnspecified; |
|
364 TriState stOs = eUnspecified; |
|
365 + TriState stDesktop = eUnspecified; |
|
366 |
|
367 PRBool badFlag = PR_FALSE; |
|
368 |
|
369 while (nsnull != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
|
370 !badFlag) { |
|
371 NS_ConvertASCIItoUTF16 wtoken(token); |
|
372 ToLowerCase(wtoken); |
|
373 |
|
374 if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
375 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
376 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
377 CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
|
378 CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
|
379 continue; |
|
380 |
|
381 LogMessageWithContext(manifestURI, line, nsIScriptError::warningFlag, |
|
382 "Warning: Unrecognized chrome registration modifier '%s'.", |
|
383 token); |
|
384 badFlag = PR_TRUE; |
|
385 } |
|
386 |
|
387 if (badFlag || stApp == eBad || stAppVersion == eBad || |
|
388 - stOs == eBad || stOsVersion == eBad) |
|
389 + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
|
390 continue; |
|
391 |
|
392 nsDependentCString host(package); |
|
393 |
|
394 PRBool exists; |
|
395 rv = rph->HasSubstitution(host, &exists); |
|
396 NS_ENSURE_SUCCESS(rv, rv); |
|
397 if (exists) { |
|
398 diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in |
1 diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in |
399 --- a/modules/libpref/src/Makefile.in |
2 --- a/modules/libpref/src/Makefile.in |
400 +++ b/modules/libpref/src/Makefile.in |
3 +++ b/modules/libpref/src/Makefile.in |
401 @@ -97,8 +97,10 @@ GARBAGE += $(addprefix $(DIST)/bin/defa |
4 @@ -90,14 +90,16 @@ GREPREF_FILES = $(topsrcdir)/netwerk/bas |
402 |
|
403 # Optimizer bug with GCC 3.2.2 on OS/2 |
5 # Optimizer bug with GCC 3.2.2 on OS/2 |
404 ifeq ($(OS_ARCH), OS2) |
6 ifeq ($(OS_ARCH), OS2) |
405 nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp |
7 nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp |
406 $(REPORT_BUILD) |
8 $(REPORT_BUILD) |
407 @$(MAKE_DEPS_AUTO_CXX) |
9 @$(MAKE_DEPS_AUTO_CXX) |
408 $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:-O2=-O1) $(_VPATH_SRCS) |
10 $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:-O2=-O1) $(_VPATH_SRCS) |
409 endif |
11 endif |
410 + |
12 |
411 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre |
13 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre |
|
14 + |
|
15 |
|
16 greprefs.js: $(GREPREF_FILES) |
|
17 $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ > $@ |
|
18 |
|
19 libs:: greprefs.js |
|
20 $(INSTALL) $^ $(DIST)/bin/ |
412 diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp |
21 diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp |
413 --- a/modules/libpref/src/nsPrefService.cpp |
22 --- a/modules/libpref/src/nsPrefService.cpp |
414 +++ b/modules/libpref/src/nsPrefService.cpp |
23 +++ b/modules/libpref/src/nsPrefService.cpp |
415 @@ -47,16 +47,17 @@ |
24 @@ -51,16 +51,17 @@ |
416 #include "nsILocalFile.h" |
25 #include "nsILocalFile.h" |
417 #include "nsIObserverService.h" |
26 #include "nsIObserverService.h" |
418 #include "nsPrefBranch.h" |
27 #include "nsPrefBranch.h" |
419 #include "nsXPIDLString.h" |
28 #include "nsXPIDLString.h" |
420 #include "nsCRT.h" |
29 #include "nsCRT.h" |
428 #include "pldhash.h" |
37 #include "pldhash.h" |
429 |
38 |
430 #include "prefapi.h" |
39 #include "prefapi.h" |
431 #include "prefread.h" |
40 #include "prefread.h" |
432 #include "prefapi_private_data.h" |
41 #include "prefapi_private_data.h" |
433 @@ -610,17 +611,18 @@ pref_LoadPrefsInDir(nsIFile* aDir, char |
42 @@ -718,28 +719,40 @@ static nsresult pref_InitDefaults() |
434 rv = rv2; |
43 /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */ |
435 } |
44 static const char* specialFiles[] = { |
436 } |
45 #if defined(XP_MAC) || defined(XP_MACOSX) |
437 } |
46 "macprefs.js" |
438 |
47 #elif defined(XP_WIN) |
439 return rv; |
48 "winpref.js" |
440 } |
49 #elif defined(XP_UNIX) |
441 |
50 "unix.js" |
442 -static nsresult pref_LoadPrefsInDirList(const char *listId) |
51 + , "" // placeholder for KDE (empty is otherwise harmless) |
443 +static nsresult pref_LoadPrefsInDirList(const char *listId, |
|
444 + char const *const *aSpecialFiles = NULL, PRUint32 aSpecialFilesCount = 0) |
|
445 { |
|
446 nsresult rv; |
|
447 nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); |
|
448 if (NS_FAILED(rv)) return rv; |
|
449 |
|
450 nsCOMPtr<nsISimpleEnumerator> dirList; |
|
451 dirSvc->Get(listId, |
|
452 NS_GET_IID(nsISimpleEnumerator), |
|
453 @@ -629,17 +631,17 @@ static nsresult pref_LoadPrefsInDirList( |
|
454 PRBool hasMore; |
|
455 while (NS_SUCCEEDED(dirList->HasMoreElements(&hasMore)) && hasMore) { |
|
456 nsCOMPtr<nsISupports> elem; |
|
457 dirList->GetNext(getter_AddRefs(elem)); |
|
458 if (elem) { |
|
459 nsCOMPtr<nsIFile> dir = do_QueryInterface(elem); |
|
460 if (dir) { |
|
461 // Do we care if a file provided by this process fails to load? |
|
462 - pref_LoadPrefsInDir(dir, nsnull, 0); |
|
463 + pref_LoadPrefsInDir(dir, aSpecialFiles, aSpecialFilesCount); |
|
464 } |
|
465 } |
|
466 } |
|
467 } |
|
468 return NS_OK; |
|
469 } |
|
470 |
|
471 //---------------------------------------------------------------------------------------- |
|
472 @@ -680,29 +682,41 @@ static nsresult pref_InitInitialObjects( |
|
473 #if defined(VMS) |
52 #if defined(VMS) |
474 , "openvms.js" |
53 , "openvms.js" |
475 #elif defined(_AIX) |
54 #elif defined(_AIX) |
476 , "aix.js" |
55 , "aix.js" |
477 #endif |
56 #endif |
478 #if defined(MOZ_WIDGET_PHOTON) |
|
479 , "photon.js" |
|
480 #endif |
|
481 + , "" // placeholder for KDE (empty is otherwise harmless) |
|
482 #elif defined(XP_OS2) |
57 #elif defined(XP_OS2) |
483 "os2pref.js" |
58 "os2pref.js" |
484 #elif defined(XP_BEOS) |
59 #elif defined(XP_BEOS) |
485 "beos.js" |
60 "beos.js" |
486 #endif |
61 #endif |
487 }; |
62 }; |
488 |
63 |
489 + if( nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper? |
64 + if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper? |
490 + for( int i = 0; |
65 + for( int i = 0; |
491 + i < NS_ARRAY_LENGTH(specialFiles); |
66 + i < NS_ARRAY_LENGTH(specialFiles); |
492 + ++i ) { |
67 + ++i ) { |
493 + if( *specialFiles[ i ] == '\0' ) { |
68 + if( *specialFiles[ i ] == '\0' ) { |
494 + specialFiles[ i ] = "kde.js"; |
69 + specialFiles[ i ] = "kde.js"; |
495 + break; |
70 + break; |
496 + } |
|
497 + } |
71 + } |
|
72 + } |
498 + } |
73 + } |
499 + |
74 + |
500 rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles)); |
75 rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles)); |
501 if (NS_FAILED(rv)) { |
76 if (NS_FAILED(rv)) { |
502 NS_WARNING("Error parsing application default preferences."); |
77 NS_WARNING("Error parsing application default preferences."); |
503 } |
78 } |
504 |
79 |
505 - rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST); |
80 return NS_OK; |
506 + rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST, specialFiles, NS_ARRAY_LENGTH(specialFiles)); |
81 } |
507 NS_ENSURE_SUCCESS(rv, rv); |
82 |
508 |
|
509 NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID, |
|
510 nsnull, NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID); |
|
511 |
|
512 nsCOMPtr<nsIObserverService> observerService = |
|
513 do_GetService("@mozilla.org/observer-service;1", &rv); |
|
514 |
|
515 diff --git a/toolkit/components/downloads/src/Makefile.in b/toolkit/components/downloads/src/Makefile.in |
83 diff --git a/toolkit/components/downloads/src/Makefile.in b/toolkit/components/downloads/src/Makefile.in |
516 --- a/toolkit/components/downloads/src/Makefile.in |
84 --- a/toolkit/components/downloads/src/Makefile.in |
517 +++ b/toolkit/components/downloads/src/Makefile.in |
85 +++ b/toolkit/components/downloads/src/Makefile.in |
518 @@ -92,8 +92,9 @@ EXTRA_COMPONENTS = \ |
86 @@ -71,8 +71,9 @@ EXTRA_COMPONENTS = \ |
519 nsDownloadManagerUI.js \ |
87 nsDownloadManagerUI.manifest \ |
520 $(NULL) |
88 $(NULL) |
521 endif |
89 endif |
522 |
90 |
523 include $(topsrcdir)/config/rules.mk |
91 include $(topsrcdir)/config/rules.mk |
524 |
92 |
3426 nsresult |
2923 nsresult |
3427 nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI) |
2924 nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI) |
3428 { |
2925 { |
3429 - nsresult rv = nsGNOMERegistry::LoadURL(aURI); |
2926 - nsresult rv = nsGNOMERegistry::LoadURL(aURI); |
3430 + nsresult rv = nsCommonRegistry::LoadURL(aURI); |
2927 + nsresult rv = nsCommonRegistry::LoadURL(aURI); |
|
2928 |
3431 #if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS) |
2929 #if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS) |
3432 if (NS_FAILED(rv)){ |
2930 if (NS_FAILED(rv)){ |
3433 HildonURIAction *action = hildon_uri_get_default_action(mType.get(), nsnull); |
2931 HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nsnull); |
3434 if (action) { |
2932 if (action) { |
3435 nsCAutoString spec; |
2933 nsCAutoString spec; |
3436 aURI->GetAsciiSpec(spec); |
2934 aURI->GetAsciiSpec(spec); |
3437 if (hildon_uri_open(spec.get(), action, nsnull)) |
2935 if (hildon_uri_open(spec.get(), action, nsnull)) |
3438 rv = NS_OK; |
2936 @@ -91,22 +94,22 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * |
3439 @@ -70,21 +73,21 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * |
2937 |
3440 #endif |
|
3441 return rv; |
2938 return rv; |
3442 } |
2939 } |
3443 |
2940 |
3444 NS_IMETHODIMP |
2941 NS_IMETHODIMP |
3445 nsMIMEInfoUnix::GetHasDefaultHandler(PRBool *_retval) |
2942 nsMIMEInfoUnix::GetHasDefaultHandler(PRBool *_retval) |
3446 { |
2943 { |
3447 *_retval = PR_FALSE; |
2944 *_retval = PR_FALSE; |
3448 - nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mType); |
2945 - nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType); |
3449 + nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mType); |
2946 + nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType); |
3450 if (!mimeInfo) { |
2947 if (!mimeInfo) { |
3451 nsCAutoString ext; |
2948 nsCAutoString ext; |
3452 GetPrimaryExtension(ext); |
2949 nsresult rv = GetPrimaryExtension(ext); |
3453 - mimeInfo = nsGNOMERegistry::GetFromExtension(ext); |
2950 if (NS_SUCCEEDED(rv)) { |
3454 + mimeInfo = nsCommonRegistry::GetFromExtension(ext); |
2951 - mimeInfo = nsGNOMERegistry::GetFromExtension(ext); |
|
2952 + mimeInfo = nsCommonRegistry::GetFromExtension(ext); |
|
2953 } |
3455 } |
2954 } |
3456 |
|
3457 if (mimeInfo) |
2955 if (mimeInfo) |
3458 *_retval = PR_TRUE; |
2956 *_retval = PR_TRUE; |
3459 |
2957 |
3460 if (*_retval) |
2958 if (*_retval) |
3461 return NS_OK; |
2959 return NS_OK; |
3462 |
2960 |
3463 @@ -107,25 +110,42 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
2961 @@ -149,32 +152,49 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns |
3464 nsCAutoString nativePath; |
2962 ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get())); |
3465 aFile->GetNativePath(nativePath); |
2963 if (action.isValid()) { |
3466 |
2964 action.trigger(); |
3467 #if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS) |
|
3468 if(NS_SUCCEEDED(LaunchDefaultWithDBus(PromiseFlatCString(nativePath).get()))) |
|
3469 return NS_OK; |
2965 return NS_OK; |
|
2966 } |
|
2967 return NS_ERROR_FAILURE; |
3470 #endif |
2968 #endif |
3471 |
2969 |
3472 + if( nsKDEUtils::kdeSupport()) { |
2970 + if( nsKDEUtils::kdeSupport()) { |
3473 + PRBool supports; |
2971 + PRBool supports; |
3474 + if( NS_SUCCEEDED( GetHasDefaultHandler( &supports )) && supports ) { |
2972 + if( NS_SUCCEEDED( GetHasDefaultHandler( &supports )) && supports ) { |
3475 + nsCStringArray command; |
2973 + nsCStringArray command; |
3476 + command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); |
2974 + command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); |
3477 + command.AppendCString( nativePath ); |
2975 + command.AppendCString( nativePath ); |
3478 + command.AppendCString( NS_LITERAL_CSTRING( "MIMETYPE" )); |
2976 + command.AppendCString( NS_LITERAL_CSTRING( "MIMETYPE" )); |
3479 + command.AppendCString( mType ); |
2977 + command.AppendCString( mSchemeOrType ); |
3480 + if( nsKDEUtils::command( command )) |
2978 + if( nsKDEUtils::command( command )) |
3481 + return NS_OK; |
2979 + return NS_OK; |
3482 + } |
2980 + } |
3483 + if (!mDefaultApplication) |
2981 + if (!mDefaultApplication) |
3484 + return NS_ERROR_FILE_NOT_FOUND; |
2982 + return NS_ERROR_FILE_NOT_FOUND; |
3485 + |
2983 + |
3486 + return LaunchWithIProcess(mDefaultApplication, nativePath); |
2984 + return LaunchWithIProcess(mDefaultApplication, nativePath); |
3487 + } |
2985 + } |
3488 + |
2986 + |
3489 nsCOMPtr<nsIGnomeVFSService> vfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); |
2987 nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); |
3490 if (vfs) { |
2988 nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); |
|
2989 if (giovfs) { |
|
2990 nsCOMPtr<nsIGIOMimeApp> app; |
|
2991 if (NS_SUCCEEDED(giovfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) |
|
2992 return app->Launch(nativePath); |
|
2993 } else if (gnomevfs) { |
|
2994 /* Fallback to GnomeVFS */ |
3491 nsCOMPtr<nsIGnomeVFSMimeApp> app; |
2995 nsCOMPtr<nsIGnomeVFSMimeApp> app; |
3492 if (NS_SUCCEEDED(vfs->GetAppForMimeType(mType, getter_AddRefs(app))) && app) |
2996 if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) |
3493 return app->Launch(nativePath); |
2997 return app->Launch(nativePath); |
3494 |
2998 } |
3495 // If we haven't got an app we try to get a valid one by searching for the |
2999 |
3496 // extension mapped type |
3000 // If we haven't got an app we try to get a valid one by searching for the |
3497 - nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromExtension(nativePath); |
3001 // extension mapped type |
3498 + nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromExtension(nativePath); |
3002 - nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromExtension(nativePath); |
3499 if (mimeInfo) { |
3003 + nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromExtension(nativePath); |
3500 nsCAutoString type; |
3004 if (mimeInfo) { |
3501 mimeInfo->GetType(type); |
3005 nsCAutoString type; |
3502 if (NS_SUCCEEDED(vfs->GetAppForMimeType(type, getter_AddRefs(app))) && app) |
3006 mimeInfo->GetType(type); |
|
3007 if (giovfs) { |
|
3008 nsCOMPtr<nsIGIOMimeApp> app; |
|
3009 if (NS_SUCCEEDED(giovfs->GetAppForMimeType(type, getter_AddRefs(app))) && app) |
3503 return app->Launch(nativePath); |
3010 return app->Launch(nativePath); |
3504 } |
3011 } else if (gnomevfs) { |
3505 } |
|
3506 |
|
3507 diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
3012 diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
3508 --- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
3013 --- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
3509 +++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
3014 +++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
3510 @@ -39,17 +39,17 @@ |
3015 @@ -44,17 +44,17 @@ |
3511 * ***** END LICENSE BLOCK ***** */ |
3016 #if (MOZ_PLATFORM_MAEMO == 6) |
3512 |
3017 #include <contentaction/contentaction.h> |
3513 #include <sys/types.h> |
3018 #include <QString> |
3514 #include <sys/stat.h> |
3019 #endif |
3515 |
3020 |
3516 #include "nsOSHelperAppService.h" |
3021 #include "nsOSHelperAppService.h" |
3517 #include "nsMIMEInfoUnix.h" |
3022 #include "nsMIMEInfoUnix.h" |
3518 #ifdef MOZ_WIDGET_GTK2 |
3023 #ifdef MOZ_WIDGET_GTK2 |
3519 -#include "nsGNOMERegistry.h" |
3024 -#include "nsGNOMERegistry.h" |
3945 + NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn); |
3450 + NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn); |
3946 + nsCString kdeMakeFilter( int index ); |
3451 + nsCString kdeMakeFilter( int index ); |
3947 }; |
3452 }; |
3948 |
3453 |
3949 #endif |
3454 #endif |
|
3455 diff --git a/xpcom/components/Makefile.in b/xpcom/components/Makefile.in |
|
3456 --- a/xpcom/components/Makefile.in |
|
3457 +++ b/xpcom/components/Makefile.in |
|
3458 @@ -98,10 +98,11 @@ FORCE_STATIC_LIB = 1 |
|
3459 |
|
3460 # Force use of PIC |
|
3461 FORCE_USE_PIC = 1 |
|
3462 include $(topsrcdir)/config/rules.mk |
|
3463 |
|
3464 DEFINES += -D_IMPL_NS_COM |
|
3465 |
|
3466 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) |
|
3467 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre |
|
3468 CXXFLAGS += $(MOZ_GTK2_CFLAGS) |
|
3469 endif |
|
3470 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp |
|
3471 --- a/xpcom/components/ManifestParser.cpp |
|
3472 +++ b/xpcom/components/ManifestParser.cpp |
|
3473 @@ -55,16 +55,17 @@ |
|
3474 #include "nsTextFormatter.h" |
|
3475 #include "nsVersionComparator.h" |
|
3476 #include "nsXPCOMCIDInternal.h" |
|
3477 |
|
3478 #include "nsIConsoleService.h" |
|
3479 #include "nsIScriptError.h" |
|
3480 #include "nsIXULAppInfo.h" |
|
3481 #include "nsIXULRuntime.h" |
|
3482 +#include "nsKDEUtils.h" |
|
3483 |
|
3484 struct ManifestDirective |
|
3485 { |
|
3486 const char* directive; |
|
3487 int argc; |
|
3488 |
|
3489 // Some directives should only be delivered for NS_COMPONENT_LOCATION |
|
3490 // manifests. |
|
3491 @@ -422,16 +423,17 @@ ParseManifestCommon(NSLocationType aType |
|
3492 |
|
3493 NS_NAMED_LITERAL_STRING(kPlatform, "platform"); |
|
3494 NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible"); |
|
3495 NS_NAMED_LITERAL_STRING(kApplication, "application"); |
|
3496 NS_NAMED_LITERAL_STRING(kAppVersion, "appversion"); |
|
3497 NS_NAMED_LITERAL_STRING(kOs, "os"); |
|
3498 NS_NAMED_LITERAL_STRING(kOsVersion, "osversion"); |
|
3499 NS_NAMED_LITERAL_STRING(kABI, "abi"); |
|
3500 + NS_NAMED_LITERAL_STRING(kDesktop, "desktop"); |
|
3501 |
|
3502 // Obsolete |
|
3503 NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers"); |
|
3504 |
|
3505 nsAutoString appID; |
|
3506 nsAutoString appVersion; |
|
3507 nsAutoString osTarget; |
|
3508 nsAutoString abi; |
|
3509 @@ -461,35 +463,39 @@ ParseManifestCommon(NSLocationType aType |
|
3510 CopyUTF8toUTF16(s, abi); |
|
3511 abi.Insert(PRUnichar('_'), 0); |
|
3512 abi.Insert(osTarget, 0); |
|
3513 } |
|
3514 } |
|
3515 } |
|
3516 |
|
3517 nsAutoString osVersion; |
|
3518 + nsAutoString desktop; |
|
3519 #if defined(XP_WIN) |
|
3520 OSVERSIONINFO info = { sizeof(OSVERSIONINFO) }; |
|
3521 if (GetVersionEx(&info)) { |
|
3522 nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
|
3523 info.dwMajorVersion, |
|
3524 info.dwMinorVersion); |
|
3525 } |
|
3526 + desktop = NS_LITERAL_STRING("win"); |
|
3527 #elif defined(XP_MACOSX) |
|
3528 SInt32 majorVersion, minorVersion; |
|
3529 if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) && |
|
3530 (Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr)) { |
|
3531 nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
|
3532 majorVersion, |
|
3533 minorVersion); |
|
3534 } |
|
3535 + desktop = NS_LITERAL_STRING("macosx"); |
|
3536 #elif defined(MOZ_WIDGET_GTK2) |
|
3537 nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
|
3538 gtk_major_version, |
|
3539 gtk_minor_version); |
|
3540 + desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome"); |
|
3541 #endif |
|
3542 |
|
3543 // Because contracts must be registered after CIDs, we save and process them |
|
3544 // at the end. |
|
3545 nsTArray<CachedDirective> contracts; |
|
3546 |
|
3547 char *token; |
|
3548 char *newline = buf; |
|
3549 @@ -558,24 +564,26 @@ ParseManifestCommon(NSLocationType aType |
|
3550 bool ok = true; |
|
3551 TriState stAppVersion = eUnspecified; |
|
3552 TriState stApp = eUnspecified; |
|
3553 TriState stOsVersion = eUnspecified; |
|
3554 TriState stOs = eUnspecified; |
|
3555 TriState stABI = eUnspecified; |
|
3556 bool platform = false; |
|
3557 bool contentAccessible = false; |
|
3558 + TriState stDesktop = eUnspecified; |
|
3559 |
|
3560 while (NULL != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && ok) { |
|
3561 ToLowerCase(token); |
|
3562 NS_ConvertASCIItoUTF16 wtoken(token); |
|
3563 |
|
3564 if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
|
3565 CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
3566 CheckStringFlag(kABI, wtoken, abi, stABI) || |
|
3567 + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
|
3568 CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) || |
|
3569 CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion)) |
|
3570 continue; |
|
3571 |
|
3572 if (directive->contentflags && |
|
3573 (CheckFlag(kPlatform, wtoken, platform) || |
|
3574 CheckFlag(kContentAccessible, wtoken, contentAccessible))) |
|
3575 continue; |
|
3576 @@ -594,16 +602,17 @@ ParseManifestCommon(NSLocationType aType |
|
3577 ok = false; |
|
3578 } |
|
3579 |
|
3580 if (!ok || |
|
3581 stApp == eBad || |
|
3582 stAppVersion == eBad || |
|
3583 stOs == eBad || |
|
3584 stOsVersion == eBad || |
|
3585 + stDesktop == eBad || |
|
3586 stABI == eBad) |
|
3587 continue; |
|
3588 |
|
3589 if (directive->regfunc) { |
|
3590 #ifdef MOZ_IPC |
|
3591 if (GeckoProcessType_Default != XRE_GetProcessType()) |
|
3592 continue; |
|
3593 #endif |
3950 diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in |
3594 diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in |
3951 --- a/xpcom/io/Makefile.in |
3595 --- a/xpcom/io/Makefile.in |
3952 +++ b/xpcom/io/Makefile.in |
3596 +++ b/xpcom/io/Makefile.in |
3953 @@ -195,14 +195,15 @@ DEFINES += -D_IMPL_NS_COM |
3597 @@ -191,17 +191,17 @@ include $(topsrcdir)/config/rules.mk |
|
3598 DEFINES += -D_IMPL_NS_COM |
3954 |
3599 |
3955 ifeq ($(OS_ARCH),Linux) |
3600 ifeq ($(OS_ARCH),Linux) |
3956 ifneq (,$(findstring lib64,$(libdir))) |
3601 ifneq (,$(findstring lib64,$(libdir))) |
3957 DEFINES += -DHAVE_USR_LIB64_DIR |
3602 DEFINES += -DHAVE_USR_LIB64_DIR |
3958 endif |
3603 endif |
3959 endif |
3604 endif |
3960 |
3605 |
3961 LOCAL_INCLUDES = -I.. |
3606 -LOCAL_INCLUDES = -I.. |
3962 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre |
3607 +LOCAL_INCLUDES = -I.. -I$(topsrcdir)/toolkit/xre |
3963 |
3608 |
3964 ifeq ($(MOZ_PLATFORM_MAEMO), 5) |
3609 ifeq ($(MOZ_PLATFORM_MAEMO),5) |
3965 CFLAGS += $(MOZ_DBUS_GLIB_CFLAGS) $(MOZ_PLATFORM_MAEMO_CFLAGS) |
3610 CFLAGS += $(MOZ_DBUS_CFLAGS) |
3966 CXXFLAGS += $(MOZ_DBUS_GLIB_CFLAGS) $(MOZ_PLATFORM_MAEMO_CFLAGS) |
3611 CXXFLAGS += $(MOZ_DBUS_CFLAGS) |
3967 endif |
3612 endif |
3968 |
3613 |
|
3614 ifdef MOZ_PLATFORM_MAEMO |
|
3615 CFLAGS += $(MOZ_PLATFORM_MAEMO_CFLAGS) |
3969 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp |
3616 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp |
3970 --- a/xpcom/io/nsLocalFileUnix.cpp |
3617 --- a/xpcom/io/nsLocalFileUnix.cpp |
3971 +++ b/xpcom/io/nsLocalFileUnix.cpp |
3618 +++ b/xpcom/io/nsLocalFileUnix.cpp |
3972 @@ -79,16 +79,17 @@ |
3619 @@ -91,16 +91,17 @@ |
3973 #include "nsXPIDLString.h" |
|
3974 #include "prproces.h" |
3620 #include "prproces.h" |
3975 #include "nsIDirectoryEnumerator.h" |
3621 #include "nsIDirectoryEnumerator.h" |
3976 #include "nsISimpleEnumerator.h" |
3622 #include "nsISimpleEnumerator.h" |
3977 #include "nsITimelineService.h" |
3623 #include "nsITimelineService.h" |
3978 |
3624 |
3979 #ifdef MOZ_WIDGET_GTK2 |
3625 #ifdef MOZ_WIDGET_GTK2 |
|
3626 #include "nsIGIOService.h" |
3980 #include "nsIGnomeVFSService.h" |
3627 #include "nsIGnomeVFSService.h" |
3981 +#include "nsKDEUtils.h" |
3628 +#include "nsKDEUtils.h" |
3982 #endif |
3629 #endif |
3983 |
3630 |
3984 #if (MOZ_PLATFORM_MAEMO == 5) |
3631 #ifdef XP_MACOSX |
3985 #include <glib.h> |
3632 #include <Carbon/Carbon.h> |
3986 #include <hildon-uri.h> |
3633 #include "CocoaFileUtils.h" |
3987 #include <hildon-mime.h> |
3634 #include "prmem.h" |
3988 #include <libosso.h> |
3635 #include "plbase64.h" |
3989 #endif |
3636 |
3990 @@ -1627,36 +1628,46 @@ nsLocalFile::Launch() |
3637 @@ -1818,44 +1819,50 @@ nsLocalFile::Launch() |
3991 |
3638 |
3992 return NS_OK; |
3639 return NS_OK; |
3993 } |
3640 } |
3994 #else |
3641 #else |
3995 NS_IMETHODIMP |
3642 NS_IMETHODIMP |
3996 nsLocalFile::Reveal() |
3643 nsLocalFile::Reveal() |
3997 { |
3644 { |
3998 #ifdef MOZ_WIDGET_GTK2 |
3645 #ifdef MOZ_WIDGET_GTK2 |
3999 - nsCOMPtr<nsIGnomeVFSService> vfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); |
3646 - nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); |
4000 - if (!vfs) |
3647 - nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); |
|
3648 - if (!giovfs && !gnomevfs) |
4001 - return NS_ERROR_FAILURE; |
3649 - return NS_ERROR_FAILURE; |
4002 - |
3650 - |
4003 + nsCAutoString url; |
3651 + nsCAutoString url; |
4004 PRBool isDirectory; |
3652 PRBool isDirectory; |
4005 if (NS_FAILED(IsDirectory(&isDirectory))) |
3653 if (NS_FAILED(IsDirectory(&isDirectory))) |
4006 return NS_ERROR_FAILURE; |
3654 return NS_ERROR_FAILURE; |
4007 |
3655 |
4008 if (isDirectory) { |
3656 if (isDirectory) { |
4009 - return vfs->ShowURIForInput(mPath); |
3657 - if (giovfs) |
|
3658 - return giovfs->ShowURIForInput(mPath); |
|
3659 - else |
|
3660 - /* Fallback to GnomeVFS */ |
|
3661 - return gnomevfs->ShowURIForInput(mPath); |
4010 + url = mPath; |
3662 + url = mPath; |
4011 } else { |
3663 } else { |
4012 nsCOMPtr<nsIFile> parentDir; |
3664 nsCOMPtr<nsIFile> parentDir; |
4013 nsCAutoString dirPath; |
3665 nsCAutoString dirPath; |
4014 if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) |
3666 if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) |
4015 return NS_ERROR_FAILURE; |
3667 return NS_ERROR_FAILURE; |
4016 if (NS_FAILED(parentDir->GetNativePath(dirPath))) |
3668 if (NS_FAILED(parentDir->GetNativePath(dirPath))) |
4017 return NS_ERROR_FAILURE; |
3669 return NS_ERROR_FAILURE; |
4018 |
3670 |
4019 - return vfs->ShowURIForInput(dirPath); |
3671 - if (giovfs) |
|
3672 - return giovfs->ShowURIForInput(dirPath); |
|
3673 - else |
|
3674 - return gnomevfs->ShowURIForInput(dirPath); |
4020 + url = dirPath; |
3675 + url = dirPath; |
4021 } |
3676 } |
4022 + |
3677 + |
4023 + if( nsKDEUtils::kdeSupport()) { |
3678 + if(nsKDEUtils::kdeSupport()) { |
4024 + nsCStringArray command; |
3679 + nsCStringArray command; |
4025 + command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); |
3680 + command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); |
4026 + command.AppendCString( url ); |
3681 + command.AppendCString( url ); |
4027 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
3682 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
4028 + } |
3683 + } |
4029 + |
3684 + |
4030 + nsCOMPtr<nsIGnomeVFSService> vfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); |
3685 + nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); |
4031 + if (!vfs) |
3686 + nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); |
4032 + return NS_ERROR_FAILURE; |
3687 + if (!giovfs && !gnomevfs) |
4033 + return vfs->ShowURIForInput(url); |
3688 + return NS_ERROR_FAILURE; |
4034 + |
3689 + |
4035 #else |
3690 + if (giovfs) |
|
3691 + return giovfs->ShowURIForInput(url); |
|
3692 + else |
|
3693 + return gnomevfs->ShowURIForInput(url); |
|
3694 #elif defined(XP_MACOSX) |
|
3695 CFURLRef url; |
|
3696 if (NS_SUCCEEDED(GetCFURL(&url))) { |
|
3697 nsresult rv = CocoaFileUtils::RevealFileInFinder(url); |
|
3698 ::CFRelease(url); |
|
3699 return rv; |
|
3700 } |
4036 return NS_ERROR_FAILURE; |
3701 return NS_ERROR_FAILURE; |
4037 #endif |
3702 @@ -1881,16 +1888,23 @@ nsLocalFile::Launch() |
4038 } |
|
4039 |
|
4040 NS_IMETHODIMP |
|
4041 nsLocalFile::Launch() |
|
4042 { |
|
4043 @@ -1674,16 +1685,23 @@ nsLocalFile::Launch() |
|
4044 |
3703 |
4045 if (nsnull == connection) |
3704 if (nsnull == connection) |
4046 return NS_ERROR_FAILURE; |
3705 return NS_ERROR_FAILURE; |
4047 |
3706 |
4048 if (hildon_mime_open_file(connection, mPath.get()) != kHILDON_SUCCESS) |
3707 if (hildon_mime_open_file(connection, mPath.get()) != kHILDON_SUCCESS) |