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 fbac8545cf6f461803505c2d1f57531798dee96a |
6 # Parent 04c2cbd396b26a8e08980304a436e5e12fb6a205 |
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 |
29 #endif |
29 #endif |
30 |
30 |
31 #ifdef MOZ_MEMORY |
31 #ifdef MOZ_MEMORY |
32 # include "mozmemory.h" |
32 # include "mozmemory.h" |
33 #endif |
33 #endif |
34 @@ -4535,25 +4536,37 @@ nsresult Preferences::InitInitialObjects |
34 @@ -4539,25 +4540,37 @@ nsresult Preferences::InitInitialObjects |
35 // application pref files for backwards compatibility. |
35 // application pref files for backwards compatibility. |
36 static const char* specialFiles[] = { |
36 static const char* specialFiles[] = { |
37 #if defined(XP_MACOSX) |
37 #if defined(XP_MACOSX) |
38 "macprefs.js" |
38 "macprefs.js" |
39 #elif defined(XP_WIN) |
39 #elif defined(XP_WIN) |
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 @@ -4599,17 +4612,17 @@ nsresult Preferences::InitInitialObjects |
72 @@ -4603,17 +4616,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 @@ -114,16 +114,20 @@ EXPORTS.mozilla += [ |
94 @@ -114,16 +114,20 @@ EXPORTS.mozilla += [ |
95 ] |
95 ] |
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 @@ -1209,36 +1209,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. |
1102 + |
1102 + |
1103 +#endif //nsKDERegistry_h__ |
1103 +#endif //nsKDERegistry_h__ |
1104 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1104 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1105 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1105 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1106 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1106 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1107 @@ -1,47 +1,50 @@ |
1107 @@ -1,46 +1,49 @@ |
1108 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
1108 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
1109 * |
1109 * |
1110 * This Source Code Form is subject to the terms of the Mozilla Public |
1110 * 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 |
1111 * 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/. */ |
1112 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1115 -#include "nsGNOMERegistry.h" |
1115 -#include "nsGNOMERegistry.h" |
1116 +#include "nsCommonRegistry.h" |
1116 +#include "nsCommonRegistry.h" |
1117 #include "nsIGIOService.h" |
1117 #include "nsIGIOService.h" |
1118 #include "nsNetCID.h" |
1118 #include "nsNetCID.h" |
1119 #include "nsIIOService.h" |
1119 #include "nsIIOService.h" |
1120 #include "nsAutoPtr.h" |
|
1121 #ifdef MOZ_ENABLE_DBUS |
1120 #ifdef MOZ_ENABLE_DBUS |
1122 # include "nsDBusHandlerApp.h" |
1121 # include "nsDBusHandlerApp.h" |
1123 #endif |
1122 #endif |
1124 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
1123 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
1125 +#include "nsKDEUtils.h" |
1124 +#include "nsKDEUtils.h" |
1158 } |
1157 } |
1159 |
1158 |
1160 if (*_retval) return NS_OK; |
1159 if (*_retval) return NS_OK; |
1161 |
1160 |
1162 return NS_OK; |
1161 return NS_OK; |
1163 @@ -51,16 +54,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi |
1162 @@ -50,16 +53,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi |
1164 // if mDefaultApplication is set, it means the application has been set from |
1163 // 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 |
1164 // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to |
1166 // give the GNOME answer. |
1165 // give the GNOME answer. |
1167 if (mDefaultApplication) return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile); |
1166 if (mDefaultApplication) return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile); |
1168 |
1167 |
1214 #include "nsReadableUtils.h" |
1213 #include "nsReadableUtils.h" |
1215 #include "nsUnicharUtils.h" |
1214 #include "nsUnicharUtils.h" |
1216 #include "nsIFileStreams.h" |
1215 #include "nsIFileStreams.h" |
1217 #include "nsILineInputStream.h" |
1216 #include "nsILineInputStream.h" |
1218 #include "nsIFile.h" |
1217 #include "nsIFile.h" |
1219 @@ -1024,17 +1024,17 @@ nsresult nsOSHelperAppService::GetHandle |
1218 @@ -1023,17 +1023,17 @@ nsresult nsOSHelperAppService::GetHandle |
1220 |
1219 |
1221 nsresult nsOSHelperAppService::OSProtocolHandlerExists( |
1220 nsresult nsOSHelperAppService::OSProtocolHandlerExists( |
1222 const char* aProtocolScheme, bool* aHandlerExists) { |
1221 const char* aProtocolScheme, bool* aHandlerExists) { |
1223 nsresult rv = NS_OK; |
1222 nsresult rv = NS_OK; |
1224 |
1223 |
1233 } else { |
1232 } else { |
1234 *aHandlerExists = false; |
1233 *aHandlerExists = false; |
1235 nsCOMPtr<nsIHandlerService> handlerSvc = |
1234 nsCOMPtr<nsIHandlerService> handlerSvc = |
1236 do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv); |
1235 do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv); |
1237 if (NS_SUCCEEDED(rv) && handlerSvc) { |
1236 if (NS_SUCCEEDED(rv) && handlerSvc) { |
1238 @@ -1044,17 +1044,17 @@ nsresult nsOSHelperAppService::OSProtoco |
1237 @@ -1043,17 +1043,17 @@ nsresult nsOSHelperAppService::OSProtoco |
1239 } |
1238 } |
1240 |
1239 |
1241 return rv; |
1240 return rv; |
1242 } |
1241 } |
1243 |
1242 |
1252 #endif |
1251 #endif |
1253 } |
1252 } |
1254 |
1253 |
1255 NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol( |
1254 NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol( |
1256 const nsACString& aScheme, bool* _retval) { |
1255 const nsACString& aScheme, bool* _retval) { |
1257 @@ -1141,17 +1141,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1256 @@ -1140,17 +1140,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1258 nsresult rv = |
1257 nsresult rv = |
1259 LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1258 LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1260 minorType, mime_types_description, true); |
1259 minorType, mime_types_description, true); |
1261 |
1260 |
1262 if (NS_FAILED(rv) || majorType.IsEmpty()) { |
1261 if (NS_FAILED(rv) || majorType.IsEmpty()) { |
1271 } |
1270 } |
1272 #endif |
1271 #endif |
1273 |
1272 |
1274 rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1273 rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, |
1275 minorType, mime_types_description, false); |
1274 minorType, mime_types_description, false); |
1276 @@ -1253,17 +1253,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1275 @@ -1252,17 +1252,17 @@ already_AddRefed<nsMIMEInfoBase> nsOSHel |
1277 |
1276 |
1278 // Now look up our extensions |
1277 // Now look up our extensions |
1279 nsAutoString extensions, mime_types_description; |
1278 nsAutoString extensions, mime_types_description; |
1280 LookUpExtensionsAndDescription(majorType, minorType, extensions, |
1279 LookUpExtensionsAndDescription(majorType, minorType, extensions, |
1281 mime_types_description); |
1280 mime_types_description); |
1331 |
1330 |
1332 #include "mozilla/Types.h" |
1331 #include "mozilla/Types.h" |
1333 #include "nsGtkUtils.h" |
1332 #include "nsGtkUtils.h" |
1334 #include "nsIFileURL.h" |
1333 #include "nsIFileURL.h" |
1335 #include "nsIGIOService.h" |
1334 #include "nsIGIOService.h" |
1336 @@ -20,16 +21,17 @@ |
1335 @@ -20,16 +21,18 @@ |
1337 #include "nsArrayEnumerator.h" |
1336 #include "nsArrayEnumerator.h" |
1338 #include "nsMemory.h" |
1337 #include "nsMemory.h" |
1339 #include "nsEnumeratorUtils.h" |
1338 #include "nsEnumeratorUtils.h" |
1340 #include "nsNetUtil.h" |
1339 #include "nsNetUtil.h" |
1341 #include "nsReadableUtils.h" |
1340 #include "nsReadableUtils.h" |
1342 #include "mozcontainer.h" |
1341 #include "mozcontainer.h" |
1343 |
1342 |
1344 #include "nsFilePicker.h" |
1343 #include "nsFilePicker.h" |
1345 +#include "nsKDEUtils.h" |
1344 +#include "nsKDEUtils.h" |
|
1345 +#include "nsURLHelper.h" |
1346 |
1346 |
1347 using namespace mozilla; |
1347 using namespace mozilla; |
1348 |
1348 |
1349 #define MAX_PREVIEW_SIZE 180 |
1349 #define MAX_PREVIEW_SIZE 180 |
1350 // bug 1184009 |
1350 // bug 1184009 |
1351 #define MAX_PREVIEW_SOURCE_SIZE 4096 |
1351 #define MAX_PREVIEW_SOURCE_SIZE 4096 |
1352 |
1352 |
1353 nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; |
1353 nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; |
1354 @@ -227,17 +229,19 @@ nsFilePicker::AppendFilters(int32_t aFil |
1354 @@ -227,17 +230,19 @@ nsFilePicker::AppendFilters(int32_t aFil |
1355 mAllowURLs = !!(aFilterMask & filterAllowURLs); |
1355 mAllowURLs = !!(aFilterMask & filterAllowURLs); |
1356 return nsBaseFilePicker::AppendFilters(aFilterMask); |
1356 return nsBaseFilePicker::AppendFilters(aFilterMask); |
1357 } |
1357 } |
1358 |
1358 |
1359 NS_IMETHODIMP |
1359 NS_IMETHODIMP |
1370 CopyUTF16toUTF8(aFilter, filter); |
1370 CopyUTF16toUTF8(aFilter, filter); |
1371 CopyUTF16toUTF8(aTitle, name); |
1371 CopyUTF16toUTF8(aTitle, name); |
1372 |
1372 |
1373 mFilters.AppendElement(filter); |
1373 mFilters.AppendElement(filter); |
1374 mFilterNames.AppendElement(name); |
1374 mFilterNames.AppendElement(name); |
1375 @@ -337,16 +341,39 @@ nsresult nsFilePicker::Show(int16_t* aRe |
1375 @@ -337,16 +342,39 @@ nsresult nsFilePicker::Show(int16_t* aRe |
1376 return NS_OK; |
1376 return NS_OK; |
1377 } |
1377 } |
1378 |
1378 |
1379 NS_IMETHODIMP |
1379 NS_IMETHODIMP |
1380 nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { |
1380 nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { |
1410 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
1410 GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
1411 |
1411 |
1412 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
1412 GtkFileChooserAction action = GetGtkFileChooserAction(mMode); |
1413 |
1413 |
1414 const gchar* accept_button; |
1414 const gchar* accept_button; |
1415 @@ -571,16 +598,240 @@ void nsFilePicker::Done(void* file_choos |
1415 @@ -571,16 +599,244 @@ void nsFilePicker::Done(void* file_choos |
1416 mCallback->Done(result); |
1416 mCallback->Done(result); |
1417 mCallback = nullptr; |
1417 mCallback = nullptr; |
1418 } else { |
1418 } else { |
1419 mResult = result; |
1419 mResult = result; |
1420 } |
1420 } |
1576 + mFileURL = nsCString(); |
1576 + mFileURL = nsCString(); |
1577 + else if( mAllowURLs ) |
1577 + else if( mAllowURLs ) |
1578 + mFileURL = output[ 0 ]; |
1578 + mFileURL = output[ 0 ]; |
1579 + else // GetFile() actually requires it to be url even for local files :-/ |
1579 + else // GetFile() actually requires it to be url even for local files :-/ |
1580 + { |
1580 + { |
1581 + mFileURL = nsCString( "file://" ); |
1581 + nsCOMPtr<nsIFile> localfile; |
1582 + mFileURL.Append( output[ 0 ] ); |
1582 + nsresult rv = NS_NewNativeLocalFile( output[ 0 ], |
|
1583 + PR_FALSE, |
|
1584 + getter_AddRefs(localfile)); |
|
1585 + if (NS_SUCCEEDED(rv)) |
|
1586 + rv = net_GetURLSpecFromActualFile(localfile, mFileURL); |
1583 + } |
1587 + } |
1584 + } |
1588 + } |
1585 + // Remember last used directory. |
1589 + // Remember last used directory. |
1586 + nsCOMPtr<nsIFile> file; |
1590 + nsCOMPtr<nsIFile> file; |
1587 + GetFile(getter_AddRefs(file)); |
1591 + GetFile(getter_AddRefs(file)); |