1 # HG changeset patch |
1 # HG changeset patch |
2 # User msirringhaus@suse.de |
2 # User msirringhaus@suse.de |
3 # Date 1559294891 -7200 |
3 # Date 1559294891 -7200 |
4 # Fri May 31 11:28:11 2019 +0200 |
4 # Fri May 31 11:28:11 2019 +0200 |
5 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112 |
5 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112 |
6 # Parent 86d7ace0b36abf542e56fbb702a5f9b308b9bf77 |
6 # Parent b517aa8dfa37d729db9590fe699caa38f899dfba |
7 Description: Add KDE integration to Firefox (toolkit parts) |
7 Description: Add KDE integration to Firefox (toolkit parts) |
8 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org> |
8 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org> |
9 Author: Lubos Lunak <lunak@suse.com> |
9 Author: Lubos Lunak <lunak@suse.com> |
10 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 |
10 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 |
11 https://bugzilla.novell.com/show_bug.cgi?id=170055 |
11 https://bugzilla.novell.com/show_bug.cgi?id=170055 |
12 |
12 |
13 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp |
13 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp |
14 --- a/modules/libpref/Preferences.cpp |
14 --- a/modules/libpref/Preferences.cpp |
15 +++ b/modules/libpref/Preferences.cpp |
15 +++ b/modules/libpref/Preferences.cpp |
16 @@ -88,16 +88,17 @@ |
16 @@ -83,16 +83,17 @@ |
17 #include "nsXPCOM.h" |
17 #include "nsXPCOM.h" |
18 #include "nsXULAppAPI.h" |
18 #include "nsXULAppAPI.h" |
19 #include "nsZipArchive.h" |
19 #include "nsZipArchive.h" |
20 #include "plbase64.h" |
20 #include "plbase64.h" |
21 #include "PLDHashTable.h" |
21 #include "PLDHashTable.h" |
67 NS_WARNING("Error parsing application default preferences."); |
67 NS_WARNING("Error parsing application default preferences."); |
68 } |
68 } |
69 |
69 |
70 // Load jar:$app/omni.jar!/defaults/preferences/*.js |
70 // Load jar:$app/omni.jar!/defaults/preferences/*.js |
71 // or jar:$gre/omni.jar!/defaults/preferences/*.js. |
71 // or jar:$gre/omni.jar!/defaults/preferences/*.js. |
72 @@ -4606,17 +4619,17 @@ nsresult Preferences::InitInitialObjects |
72 @@ -4630,17 +4643,17 @@ nsresult Preferences::InitInitialObjects |
73 } |
73 } |
74 |
74 |
75 nsCOMPtr<nsIFile> path = do_QueryInterface(elem); |
75 nsCOMPtr<nsIFile> path = do_QueryInterface(elem); |
76 if (!path) { |
76 if (!path) { |
77 continue; |
77 continue; |
85 |
85 |
86 if (XRE_IsParentProcess()) { |
86 if (XRE_IsParentProcess()) { |
87 SetupTelemetryPref(); |
87 SetupTelemetryPref(); |
88 } |
88 } |
89 |
89 |
90 NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID, nullptr, |
90 if (aIsStartup) { |
91 diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build |
91 diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build |
92 --- a/modules/libpref/moz.build |
92 --- a/modules/libpref/moz.build |
93 +++ b/modules/libpref/moz.build |
93 +++ b/modules/libpref/moz.build |
94 @@ -110,16 +110,20 @@ EXPORTS.mozilla += [ |
94 @@ -114,16 +114,20 @@ EXPORTS.mozilla += [ |
95 ] |
95 ] |
96 EXPORTS.mozilla += sorted(['!' + g for g in gen_h]) |
96 EXPORTS.mozilla += sorted(['!' + g for g in gen_h]) |
97 |
97 |
98 UNIFIED_SOURCES += [ |
98 UNIFIED_SOURCES += [ |
99 'Preferences.cpp', |
99 'Preferences.cpp', |
134 flags = Flags('contentaccessible=yes', 'appversion>=3.5') |
134 flags = Flags('contentaccessible=yes', 'appversion>=3.5') |
135 ''' |
135 ''' |
136 diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py |
136 diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py |
137 --- a/python/mozbuild/mozpack/chrome/manifest.py |
137 --- a/python/mozbuild/mozpack/chrome/manifest.py |
138 +++ b/python/mozbuild/mozpack/chrome/manifest.py |
138 +++ b/python/mozbuild/mozpack/chrome/manifest.py |
139 @@ -36,16 +36,17 @@ class ManifestEntry(object): |
139 @@ -37,16 +37,17 @@ class ManifestEntry(object): |
140 'platformversion', |
140 'platformversion', |
141 'os', |
141 'os', |
142 'osversion', |
142 'osversion', |
143 'abi', |
143 'abi', |
144 'xpcnativewrappers', |
144 'xpcnativewrappers', |
155 self.base = base |
155 self.base = base |
156 self.flags = Flags(*flags) |
156 self.flags = Flags(*flags) |
157 diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build |
157 diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build |
158 --- a/toolkit/components/downloads/moz.build |
158 --- a/toolkit/components/downloads/moz.build |
159 +++ b/toolkit/components/downloads/moz.build |
159 +++ b/toolkit/components/downloads/moz.build |
160 @@ -41,10 +41,14 @@ XPCOM_MANIFESTS += [ |
160 @@ -46,10 +46,14 @@ XPCOM_MANIFESTS += [ |
161 |
161 |
162 if CONFIG['MOZ_PLACES']: |
162 if CONFIG['MOZ_PLACES']: |
163 EXTRA_JS_MODULES += [ |
163 EXTRA_JS_MODULES += [ |
164 'DownloadHistory.jsm', |
164 'DownloadHistory.jsm', |
165 ] |
165 ] |
173 with Files('**'): |
173 with Files('**'): |
174 BUG_COMPONENT = ('Toolkit', 'Downloads API') |
174 BUG_COMPONENT = ('Toolkit', 'Downloads API') |
175 diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm |
175 diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm |
176 --- a/toolkit/mozapps/downloads/HelperAppDlg.jsm |
176 --- a/toolkit/mozapps/downloads/HelperAppDlg.jsm |
177 +++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm |
177 +++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm |
178 @@ -1199,36 +1199,66 @@ nsUnknownContentTypeDialog.prototype = { |
178 @@ -1205,36 +1205,66 @@ nsUnknownContentTypeDialog.prototype = { |
179 params.handlerApp && |
179 params.handlerApp && |
180 params.handlerApp.executable && |
180 params.handlerApp.executable && |
181 params.handlerApp.executable.isFile() |
181 params.handlerApp.executable.isFile() |
182 ) { |
182 ) { |
183 // Remember the file they chose to run. |
183 // Remember the file they chose to run. |
263 nsIFilePicker.modeOpen |
263 nsIFilePicker.modeOpen |
264 ); |
264 ); |
265 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
265 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
266 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
266 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
267 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
267 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
268 @@ -14,16 +14,17 @@ |
268 @@ -13,16 +13,17 @@ |
269 #include "nsPrintfCString.h" |
269 #include "nsPrintfCString.h" |
270 #include "nsNetCID.h" |
270 #include "nsNetCID.h" |
271 #include "nsNetUtil.h" |
271 #include "nsNetUtil.h" |
272 #include "nsISupportsPrimitives.h" |
272 #include "nsISupportsPrimitives.h" |
273 #include "nsIGSettingsService.h" |
273 #include "nsIGSettingsService.h" |
281 class nsUnixSystemProxySettings final : public nsISystemProxySettings { |
281 class nsUnixSystemProxySettings final : public nsISystemProxySettings { |
282 public: |
282 public: |
283 NS_DECL_ISUPPORTS |
283 NS_DECL_ISUPPORTS |
284 NS_DECL_NSISYSTEMPROXYSETTINGS |
284 NS_DECL_NSISYSTEMPROXYSETTINGS |
285 |
285 |
286 @@ -37,16 +38,18 @@ class nsUnixSystemProxySettings final : |
286 @@ -36,16 +37,18 @@ class nsUnixSystemProxySettings final : |
287 nsCOMPtr<nsIGSettingsCollection> mProxySettings; |
287 nsCOMPtr<nsIGSettingsCollection> mProxySettings; |
288 nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> |
288 nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> |
289 mSchemeProxySettings; |
289 mSchemeProxySettings; |
290 nsresult GetProxyFromGSettings(const nsACString& aScheme, |
290 nsresult GetProxyFromGSettings(const nsACString& aScheme, |
291 const nsACString& aHost, int32_t aPort, |
291 const nsACString& aHost, int32_t aPort, |
300 |
300 |
301 NS_IMETHODIMP |
301 NS_IMETHODIMP |
302 nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { |
302 nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { |
303 // dbus prevents us from being threadsafe, but this routine should not block |
303 // dbus prevents us from being threadsafe, but this routine should not block |
304 // anyhow |
304 // anyhow |
305 @@ -381,21 +384,50 @@ nsresult nsUnixSystemProxySettings::GetP |
305 @@ -384,21 +387,50 @@ nsresult nsUnixSystemProxySettings::GetP |
306 return NS_OK; |
306 return NS_OK; |
307 } |
307 } |
308 |
308 |
309 nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec, |
309 nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec, |
310 const nsACString& aScheme, |
310 const nsACString& aScheme, |
354 return result.forget().downcast<nsISupports>(); |
354 return result.forget().downcast<nsISupports>(); |
355 } |
355 } |
356 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build |
356 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build |
357 --- a/toolkit/xre/moz.build |
357 --- a/toolkit/xre/moz.build |
358 +++ b/toolkit/xre/moz.build |
358 +++ b/toolkit/xre/moz.build |
359 @@ -85,17 +85,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co |
359 @@ -88,17 +88,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co |
360 '../components/printingui', |
360 '../components/printingui', |
361 ] |
361 ] |
362 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': |
362 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': |
363 UNIFIED_SOURCES += [ |
363 UNIFIED_SOURCES += [ |
364 'nsNativeAppSupportDefault.cpp', |
364 'nsNativeAppSupportDefault.cpp', |
798 using mozilla::dom::HandlerApp; |
798 using mozilla::dom::HandlerApp; |
799 using mozilla::dom::HandlerInfo; |
799 using mozilla::dom::HandlerInfo; |
800 using mozilla::dom::RemoteHandlerApp; |
800 using mozilla::dom::RemoteHandlerApp; |
801 |
801 |
802 namespace { |
802 namespace { |
803 @@ -288,17 +288,17 @@ mozilla::ipc::IPCResult HandlerServicePa |
803 @@ -294,17 +294,17 @@ mozilla::ipc::IPCResult HandlerServicePa |
804 mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS( |
804 mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS( |
805 const nsCString& aProtocolScheme, bool* aHandlerExists) { |
805 const nsCString& aProtocolScheme, bool* aHandlerExists) { |
806 if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) { |
806 if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) { |
807 *aHandlerExists = false; |
807 *aHandlerExists = false; |
808 return IPC_OK(); |
808 return IPC_OK(); |
817 return IPC_OK(); |
817 return IPC_OK(); |
818 } |
818 } |
819 |
819 |
820 /* |
820 /* |
821 * Check if a handler exists for the provided protocol. Check the datastore |
821 * Check if a handler exists for the provided protocol. Check the datastore |
822 @@ -317,17 +317,17 @@ mozilla::ipc::IPCResult HandlerServicePa |
822 @@ -323,17 +323,17 @@ mozilla::ipc::IPCResult HandlerServicePa |
823 nsCOMPtr<nsIExternalProtocolService> protoSvc = |
823 nsCOMPtr<nsIExternalProtocolService> protoSvc = |
824 do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv); |
824 do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv); |
825 if (NS_WARN_IF(NS_FAILED(rv))) { |
825 if (NS_WARN_IF(NS_FAILED(rv))) { |
826 *aHandlerExists = false; |
826 *aHandlerExists = false; |
827 return IPC_OK(); |
827 return IPC_OK(); |
839 #endif |
839 #endif |
840 return IPC_OK(); |
840 return IPC_OK(); |
841 diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build |
841 diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build |
842 --- a/uriloader/exthandler/moz.build |
842 --- a/uriloader/exthandler/moz.build |
843 +++ b/uriloader/exthandler/moz.build |
843 +++ b/uriloader/exthandler/moz.build |
844 @@ -83,17 +83,19 @@ else: |
844 @@ -85,17 +85,19 @@ else: |
845 SOURCES += [ |
845 SOURCES += [ |
846 osdir + '/nsOSHelperAppService.cpp', |
846 osdir + '/nsOSHelperAppService.cpp', |
847 ] |
847 ] |
848 if CONFIG['CC_TYPE'] in ('clang', 'gcc'): |
848 if CONFIG['CC_TYPE'] in ('clang', 'gcc'): |
849 CXXFLAGS += ['-Wno-error=shadow'] |
849 CXXFLAGS += ['-Wno-error=shadow'] |
859 UNIFIED_SOURCES += [ |
859 UNIFIED_SOURCES += [ |
860 'android/nsAndroidHandlerApp.cpp', |
860 'android/nsAndroidHandlerApp.cpp', |
861 'android/nsExternalURLHandlerService.cpp', |
861 'android/nsExternalURLHandlerService.cpp', |
862 'android/nsMIMEInfoAndroid.cpp', |
862 'android/nsMIMEInfoAndroid.cpp', |
863 ] |
863 ] |
864 @@ -133,16 +135,17 @@ include('/ipc/chromium/chromium-config.m |
864 @@ -135,16 +137,17 @@ include('/ipc/chromium/chromium-config.m |
865 FINAL_LIBRARY = 'xul' |
865 FINAL_LIBRARY = 'xul' |
866 |
866 |
867 LOCAL_INCLUDES += [ |
867 LOCAL_INCLUDES += [ |
868 '/docshell/base', |
868 '/docshell/base', |
869 '/dom/base', |
869 '/dom/base', |
972 +#endif |
972 +#endif |
973 diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp |
973 diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp |
974 new file mode 100644 |
974 new file mode 100644 |
975 --- /dev/null |
975 --- /dev/null |
976 +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp |
976 +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp |
977 @@ -0,0 +1,87 @@ |
977 @@ -0,0 +1,86 @@ |
978 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
978 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
979 +/* This Source Code Form is subject to the terms of the Mozilla Public |
979 +/* This Source Code Form is subject to the terms of the Mozilla Public |
980 + * License, v. 2.0. If a copy of the MPL was not distributed with this |
980 + * License, v. 2.0. If a copy of the MPL was not distributed with this |
981 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
981 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
982 + |
982 + |
983 +#include "nsKDERegistry.h" |
983 +#include "nsKDERegistry.h" |
984 +#include "prlink.h" |
984 +#include "prlink.h" |
985 +#include "prmem.h" |
985 +#include "prmem.h" |
986 +#include "nsString.h" |
986 +#include "nsString.h" |
987 +#include "nsMIMEInfoUnix.h" |
987 +#include "nsMIMEInfoUnix.h" |
988 +#include "nsAutoPtr.h" |
|
989 +#include "nsKDEUtils.h" |
988 +#include "nsKDEUtils.h" |
990 + |
989 + |
991 +/* static */ bool |
990 +/* static */ bool |
992 +nsKDERegistry::HandlerExists(const char *aProtocolScheme) |
991 +nsKDERegistry::HandlerExists(const char *aProtocolScheme) |
993 +{ |
992 +{ |
1102 + |
1101 + |
1103 +#endif //nsKDERegistry_h__ |
1102 +#endif //nsKDERegistry_h__ |
1104 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1103 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1105 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1104 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1106 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1105 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1107 @@ -1,47 +1,50 @@ |
1106 @@ -1,46 +1,49 @@ |
1108 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
1107 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
1109 * |
1108 * |
1110 * This Source Code Form is subject to the terms of the Mozilla Public |
1109 * This Source Code Form is subject to the terms of the Mozilla Public |
1111 * License, v. 2.0. If a copy of the MPL was not distributed with this |
1110 * License, v. 2.0. If a copy of the MPL was not distributed with this |
1112 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1111 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1115 -#include "nsGNOMERegistry.h" |
1114 -#include "nsGNOMERegistry.h" |
1116 +#include "nsCommonRegistry.h" |
1115 +#include "nsCommonRegistry.h" |
1117 #include "nsIGIOService.h" |
1116 #include "nsIGIOService.h" |
1118 #include "nsNetCID.h" |
1117 #include "nsNetCID.h" |
1119 #include "nsIIOService.h" |
1118 #include "nsIIOService.h" |
1120 #include "nsAutoPtr.h" |
|
1121 #ifdef MOZ_ENABLE_DBUS |
1119 #ifdef MOZ_ENABLE_DBUS |
1122 # include "nsDBusHandlerApp.h" |
1120 # include "nsDBusHandlerApp.h" |
1123 #endif |
1121 #endif |
1124 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
1122 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
1125 +#include "nsKDEUtils.h" |
1123 +#include "nsKDEUtils.h" |
1158 } |
1156 } |
1159 |
1157 |
1160 if (*_retval) return NS_OK; |
1158 if (*_retval) return NS_OK; |
1161 |
1159 |
1162 return NS_OK; |
1160 return NS_OK; |
1163 @@ -51,16 +54,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi |
1161 @@ -50,16 +53,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi |
1164 // if mDefaultApplication is set, it means the application has been set from |
1162 // if mDefaultApplication is set, it means the application has been set from |
1165 // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to |
1163 // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to |
1166 // give the GNOME answer. |
1164 // give the GNOME answer. |
1167 if (mDefaultApplication) return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile); |
1165 if (mDefaultApplication) return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile); |
1168 |
1166 |
1211 #endif |
1209 #endif |
1212 #include "nsISupports.h" |
1210 #include "nsISupports.h" |
1213 #include "nsString.h" |
1211 #include "nsString.h" |
1214 #include "nsReadableUtils.h" |
1212 #include "nsReadableUtils.h" |
1215 #include "nsUnicharUtils.h" |
1213 #include "nsUnicharUtils.h" |
1216 #include "nsIURL.h" |
|
1217 #include "nsIFileStreams.h" |
1214 #include "nsIFileStreams.h" |
1218 #include "nsILineInputStream.h" |
1215 #include "nsILineInputStream.h" |
1219 @@ -1025,17 +1025,17 @@ nsresult nsOSHelperAppService::GetHandle |
1216 #include "nsIFile.h" |
|
1217 @@ -1023,17 +1023,17 @@ nsresult nsOSHelperAppService::GetHandle |
1220 |
1218 |
1221 nsresult nsOSHelperAppService::OSProtocolHandlerExists( |
1219 nsresult nsOSHelperAppService::OSProtocolHandlerExists( |
1222 const char* aProtocolScheme, bool* aHandlerExists) { |
1220 const char* aProtocolScheme, bool* aHandlerExists) { |
1223 nsresult rv = NS_OK; |
1221 nsresult rv = NS_OK; |
1224 |
1222 |
1250 #else |
1248 #else |
1251 return NS_ERROR_NOT_AVAILABLE; |
1249 return NS_ERROR_NOT_AVAILABLE; |
1252 #endif |
1250 #endif |
1253 } |
1251 } |
1254 |
1252 |
1255 nsresult nsOSHelperAppService::GetFileTokenForPath( |
1253 NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol( |
1256 const char16_t* platformAppPath, nsIFile** aFile) { |
1254 const nsACString& aScheme, bool* _retval) { |
1257 @@ -1136,17 +1136,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1255 @@ -1140,17 +1140,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1258 nsresult rv = |
1256 nsresult rv = |
1259 LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1257 LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1260 minorType, mime_types_description, true); |
1258 minorType, mime_types_description, true); |
1261 |
1259 |
1262 if (NS_FAILED(rv) || majorType.IsEmpty()) { |
1260 if (NS_FAILED(rv) || majorType.IsEmpty()) { |
1271 } |
1269 } |
1272 #endif |
1270 #endif |
1273 |
1271 |
1274 rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1272 rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1275 minorType, mime_types_description, false); |
1273 minorType, mime_types_description, false); |
1276 @@ -1248,17 +1248,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1274 @@ -1252,17 +1252,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1277 |
1275 |
1278 // Now look up our extensions |
1276 // Now look up our extensions |
1279 nsAutoString extensions, mime_types_description; |
1277 nsAutoString extensions, mime_types_description; |
1280 LookUpExtensionsAndDescription(majorType, minorType, extensions, |
1278 LookUpExtensionsAndDescription(majorType, minorType, extensions, |
1281 mime_types_description); |
1279 mime_types_description); |
1293 NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?"); |
1291 NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?"); |
1294 gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions)); |
1292 gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions)); |
1295 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build |
1293 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build |
1296 --- a/widget/gtk/moz.build |
1294 --- a/widget/gtk/moz.build |
1297 +++ b/widget/gtk/moz.build |
1295 +++ b/widget/gtk/moz.build |
1298 @@ -126,16 +126,17 @@ include('/ipc/chromium/chromium-config.m |
1296 @@ -129,16 +129,17 @@ include('/ipc/chromium/chromium-config.m |
1299 |
1297 |
1300 FINAL_LIBRARY = 'xul' |
1298 FINAL_LIBRARY = 'xul' |
1301 |
1299 |
1302 LOCAL_INCLUDES += [ |
1300 LOCAL_INCLUDES += [ |
1303 '/layout/base', |
1301 '/layout/base', |
1314 '/widget/x11', |
1312 '/widget/x11', |
1315 ] |
1313 ] |
1316 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp |
1314 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp |
1317 --- a/widget/gtk/nsFilePicker.cpp |
1315 --- a/widget/gtk/nsFilePicker.cpp |
1318 +++ b/widget/gtk/nsFilePicker.cpp |
1316 +++ b/widget/gtk/nsFilePicker.cpp |
1319 @@ -4,16 +4,17 @@ |
1317 @@ -1,15 +1,16 @@ |
|
1318 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
1319 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
1320 * License, v. 2.0. If a copy of the MPL was not distributed with this |
1320 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1321 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1321 |
1322 |
1322 #include "mozilla/Types.h" |
1323 #include <dlfcn.h> |
|
1324 #include <gtk/gtk.h> |
|
1325 +#include <gdk/gdkx.h> |
1323 #include <sys/types.h> |
1326 #include <sys/types.h> |
1324 #include <sys/stat.h> |
1327 #include <sys/stat.h> |
1325 #include <unistd.h> |
1328 #include <unistd.h> |
1326 |
1329 |
1327 #include <gtk/gtk.h> |
1330 #include "mozilla/Types.h" |
1328 +#include <gdk/gdkx.h> |
|
1329 |
|
1330 #include "nsGtkUtils.h" |
1331 #include "nsGtkUtils.h" |
1331 #include "nsIFileURL.h" |
1332 #include "nsIFileURL.h" |
1332 #include "nsIGIOService.h" |
1333 #include "nsIGIOService.h" |
1333 #include "nsIURI.h" |
1334 @@ -20,16 +21,18 @@ |
1334 #include "nsIWidget.h" |
|
1335 #include "nsIFile.h" |
|
1336 #include "nsIStringBundle.h" |
|
1337 @@ -21,16 +22,17 @@ |
|
1338 #include "nsArrayEnumerator.h" |
1335 #include "nsArrayEnumerator.h" |
1339 #include "nsMemory.h" |
1336 #include "nsMemory.h" |
1340 #include "nsEnumeratorUtils.h" |
1337 #include "nsEnumeratorUtils.h" |
1341 #include "nsNetUtil.h" |
1338 #include "nsNetUtil.h" |
1342 #include "nsReadableUtils.h" |
1339 #include "nsReadableUtils.h" |
1343 #include "mozcontainer.h" |
1340 #include "mozcontainer.h" |
1344 |
1341 |
1345 #include "nsFilePicker.h" |
1342 #include "nsFilePicker.h" |
1346 +#include "nsKDEUtils.h" |
1343 +#include "nsKDEUtils.h" |
|
1344 +#include "nsURLHelper.h" |
1347 |
1345 |
1348 using namespace mozilla; |
1346 using namespace mozilla; |
1349 |
1347 |
1350 #define MAX_PREVIEW_SIZE 180 |
1348 #define MAX_PREVIEW_SIZE 180 |
1351 // bug 1184009 |
1349 // bug 1184009 |
1352 #define MAX_PREVIEW_SOURCE_SIZE 4096 |
1350 #define MAX_PREVIEW_SOURCE_SIZE 4096 |
1353 |
1351 |
1354 nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; |
1352 nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; |
1355 @@ -228,17 +230,19 @@ nsFilePicker::AppendFilters(int32_t aFil |
1353 @@ -223,17 +226,19 @@ nsFilePicker::AppendFilters(int32_t aFil |
1356 mAllowURLs = !!(aFilterMask & filterAllowURLs); |
1354 mAllowURLs = !!(aFilterMask & filterAllowURLs); |
1357 return nsBaseFilePicker::AppendFilters(aFilterMask); |
1355 return nsBaseFilePicker::AppendFilters(aFilterMask); |
1358 } |
1356 } |
1359 |
1357 |
1360 NS_IMETHODIMP |
1358 NS_IMETHODIMP |
1371 CopyUTF16toUTF8(aFilter, filter); |
1369 CopyUTF16toUTF8(aFilter, filter); |
1372 CopyUTF16toUTF8(aTitle, name); |
1370 CopyUTF16toUTF8(aTitle, name); |
1373 |
1371 |
1374 mFilters.AppendElement(filter); |
1372 mFilters.AppendElement(filter); |
1375 mFilterNames.AppendElement(name); |
1373 mFilterNames.AppendElement(name); |
1376 @@ -338,16 +342,39 @@ nsresult nsFilePicker::Show(int16_t* aRe |
1374 @@ -333,16 +338,39 @@ nsresult nsFilePicker::Show(int16_t* aRe |
1377 return NS_OK; |
1375 return NS_OK; |
1378 } |
1376 } |
1379 |
1377 |
1380 NS_IMETHODIMP |
1378 NS_IMETHODIMP |
1381 nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { |
1379 nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { |
1403 + }, this); |
1401 + }, this); |
1404 + |
1402 + |
1405 + return NS_OK; |
1403 + return NS_OK; |
1406 + } |
1404 + } |
1407 + |
1405 + |
1408 nsCString title; |
1406 NS_ConvertUTF16toUTF8 title(mTitle); |
1409 title.Adopt(ToNewUTF8String(mTitle)); |
|
1410 |
1407 |
1411 GtkWindow* parent_widget = |
1408 GtkWindow* parent_widget = |
1412 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
1409 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
1413 |
1410 |
1414 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
1411 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
1415 |
1412 |
1416 @@ -573,16 +600,240 @@ void nsFilePicker::Done(void* file_choos |
1413 const gchar* accept_button; |
|
1414 @@ -562,16 +590,244 @@ void nsFilePicker::Done(void* file_choos |
1417 mCallback->Done(result); |
1415 mCallback->Done(result); |
1418 mCallback = nullptr; |
1416 mCallback = nullptr; |
1419 } else { |
1417 } else { |
1420 mResult = result; |
1418 mResult = result; |
1421 } |
1419 } |
1577 + mFileURL = nsCString(); |
1575 + mFileURL = nsCString(); |
1578 + else if( mAllowURLs ) |
1576 + else if( mAllowURLs ) |
1579 + mFileURL = output[ 0 ]; |
1577 + mFileURL = output[ 0 ]; |
1580 + else // GetFile() actually requires it to be url even for local files :-/ |
1578 + else // GetFile() actually requires it to be url even for local files :-/ |
1581 + { |
1579 + { |
1582 + mFileURL = nsCString( "file://" ); |
1580 + nsCOMPtr<nsIFile> localfile; |
1583 + mFileURL.Append( output[ 0 ] ); |
1581 + nsresult rv = NS_NewNativeLocalFile( output[ 0 ], |
|
1582 + PR_FALSE, |
|
1583 + getter_AddRefs(localfile)); |
|
1584 + if (NS_SUCCEEDED(rv)) |
|
1585 + rv = net_GetURLSpecFromActualFile(localfile, mFileURL); |
1584 + } |
1586 + } |
1585 + } |
1587 + } |
1586 + // Remember last used directory. |
1588 + // Remember last used directory. |
1587 + nsCOMPtr<nsIFile> file; |
1589 + nsCOMPtr<nsIFile> file; |
1588 + GetFile(getter_AddRefs(file)); |
1590 + GetFile(getter_AddRefs(file)); |
1826 + '/toolkit/xre', |
1828 + '/toolkit/xre', |
1827 ] |
1829 ] |
1828 |
1830 |
1829 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': |
1831 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': |
1830 CXXFLAGS += CONFIG['TK_CFLAGS'] |
1832 CXXFLAGS += CONFIG['TK_CFLAGS'] |
|
1833 if CONFIG['MOZ_ENABLE_DBUS']: |
|
1834 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS'] |
1831 |
1835 |
1832 if CONFIG['MOZ_LAYOUT_DEBUGGER']: |
1836 if CONFIG['MOZ_LAYOUT_DEBUGGER']: |
1833 DEFINES['MOZ_LAYOUT_DEBUGGER'] = True |
|
1834 |
|
1835 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp |
1837 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp |
1836 --- a/xpcom/io/nsLocalFileUnix.cpp |
1838 --- a/xpcom/io/nsLocalFileUnix.cpp |
1837 +++ b/xpcom/io/nsLocalFileUnix.cpp |
1839 +++ b/xpcom/io/nsLocalFileUnix.cpp |
1838 @@ -47,16 +47,17 @@ |
1840 @@ -46,16 +46,17 @@ |
1839 #include "prproces.h" |
1841 #include "prproces.h" |
1840 #include "nsIDirectoryEnumerator.h" |
1842 #include "nsIDirectoryEnumerator.h" |
1841 #include "nsSimpleEnumerator.h" |
1843 #include "nsSimpleEnumerator.h" |
1842 #include "private/pprio.h" |
1844 #include "private/pprio.h" |
1843 #include "prlink.h" |
1845 #include "prlink.h" |
1851 # include <Carbon/Carbon.h> |
1853 # include <Carbon/Carbon.h> |
1852 # include "CocoaFileUtils.h" |
1854 # include "CocoaFileUtils.h" |
1853 # include "prmem.h" |
1855 # include "prmem.h" |
1854 # include "plbase64.h" |
1856 # include "plbase64.h" |
1855 |
1857 |
1856 @@ -1902,62 +1903,77 @@ nsLocalFile::SetPersistentDescriptor(con |
1858 @@ -1907,62 +1908,77 @@ nsLocalFile::SetPersistentDescriptor(con |
1857 |
1859 |
1858 NS_IMETHODIMP |
1860 NS_IMETHODIMP |
1859 nsLocalFile::Reveal() { |
1861 nsLocalFile::Reveal() { |
1860 if (!FilePreferences::IsAllowedPath(mPath)) { |
1862 if (!FilePreferences::IsAllowedPath(mPath)) { |
1861 return NS_ERROR_FILE_ACCESS_DENIED; |
1863 return NS_ERROR_FILE_ACCESS_DENIED; |