diff -r 52b1745787cf -r 146af4f081b9 mozilla-kde.patch --- a/mozilla-kde.patch Mon Nov 25 08:41:45 2019 +0100 +++ b/mozilla-kde.patch Thu Jun 11 22:04:26 2020 +0200 @@ -3,7 +3,7 @@ # Date 1559294891 -7200 # Fri May 31 11:28:11 2019 +0200 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112 -# Parent 86d7ace0b36abf542e56fbb702a5f9b308b9bf77 +# Parent b517aa8dfa37d729db9590fe699caa38f899dfba Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak @@ -13,7 +13,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp -@@ -88,16 +88,17 @@ +@@ -83,16 +83,17 @@ #include "nsXPCOM.h" #include "nsXULAppAPI.h" #include "nsZipArchive.h" @@ -31,7 +31,7 @@ #ifdef MOZ_MEMORY # include "mozmemory.h" #endif -@@ -4542,25 +4543,37 @@ nsresult Preferences::InitInitialObjects +@@ -4566,25 +4567,37 @@ nsresult Preferences::InitInitialObjects // application pref files for backwards compatibility. static const char* specialFiles[] = { #if defined(XP_MACOSX) @@ -69,7 +69,7 @@ // Load jar:$app/omni.jar!/defaults/preferences/*.js // or jar:$gre/omni.jar!/defaults/preferences/*.js. -@@ -4606,17 +4619,17 @@ nsresult Preferences::InitInitialObjects +@@ -4630,17 +4643,17 @@ nsresult Preferences::InitInitialObjects } nsCOMPtr path = do_QueryInterface(elem); @@ -87,11 +87,11 @@ SetupTelemetryPref(); } - NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID, nullptr, + if (aIsStartup) { diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build --- a/modules/libpref/moz.build +++ b/modules/libpref/moz.build -@@ -110,16 +110,20 @@ EXPORTS.mozilla += [ +@@ -114,16 +114,20 @@ EXPORTS.mozilla += [ ] EXPORTS.mozilla += sorted(['!' + g for g in gen_h]) @@ -136,7 +136,7 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py --- a/python/mozbuild/mozpack/chrome/manifest.py +++ b/python/mozbuild/mozpack/chrome/manifest.py -@@ -36,16 +36,17 @@ class ManifestEntry(object): +@@ -37,16 +37,17 @@ class ManifestEntry(object): 'platformversion', 'os', 'osversion', @@ -157,7 +157,7 @@ diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build --- a/toolkit/components/downloads/moz.build +++ b/toolkit/components/downloads/moz.build -@@ -41,10 +41,14 @@ XPCOM_MANIFESTS += [ +@@ -46,10 +46,14 @@ XPCOM_MANIFESTS += [ if CONFIG['MOZ_PLACES']: EXTRA_JS_MODULES += [ @@ -175,7 +175,7 @@ diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm --- a/toolkit/mozapps/downloads/HelperAppDlg.jsm +++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm -@@ -1199,36 +1199,66 @@ nsUnknownContentTypeDialog.prototype = { +@@ -1205,36 +1205,66 @@ nsUnknownContentTypeDialog.prototype = { params.handlerApp && params.handlerApp.executable && params.handlerApp.executable.isFile() @@ -265,7 +265,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp -@@ -14,16 +14,17 @@ +@@ -13,16 +13,17 @@ #include "nsPrintfCString.h" #include "nsNetCID.h" #include "nsNetUtil.h" @@ -283,7 +283,7 @@ NS_DECL_ISUPPORTS NS_DECL_NSISYSTEMPROXYSETTINGS -@@ -37,16 +38,18 @@ class nsUnixSystemProxySettings final : +@@ -36,16 +37,18 @@ class nsUnixSystemProxySettings final : nsCOMPtr mProxySettings; nsInterfaceHashtable mSchemeProxySettings; @@ -302,7 +302,7 @@ nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { // dbus prevents us from being threadsafe, but this routine should not block // anyhow -@@ -381,21 +384,50 @@ nsresult nsUnixSystemProxySettings::GetP +@@ -384,21 +387,50 @@ nsresult nsUnixSystemProxySettings::GetP return NS_OK; } @@ -356,7 +356,7 @@ diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build -@@ -85,17 +85,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co +@@ -88,17 +88,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co '../components/printingui', ] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': @@ -800,7 +800,7 @@ using mozilla::dom::RemoteHandlerApp; namespace { -@@ -288,17 +288,17 @@ mozilla::ipc::IPCResult HandlerServicePa +@@ -294,17 +294,17 @@ mozilla::ipc::IPCResult HandlerServicePa mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS( const nsCString& aProtocolScheme, bool* aHandlerExists) { if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) { @@ -819,7 +819,7 @@ /* * Check if a handler exists for the provided protocol. Check the datastore -@@ -317,17 +317,17 @@ mozilla::ipc::IPCResult HandlerServicePa +@@ -323,17 +323,17 @@ mozilla::ipc::IPCResult HandlerServicePa nsCOMPtr protoSvc = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv); if (NS_WARN_IF(NS_FAILED(rv))) { @@ -841,7 +841,7 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build --- a/uriloader/exthandler/moz.build +++ b/uriloader/exthandler/moz.build -@@ -83,17 +83,19 @@ else: +@@ -85,17 +85,19 @@ else: SOURCES += [ osdir + '/nsOSHelperAppService.cpp', ] @@ -861,7 +861,7 @@ 'android/nsExternalURLHandlerService.cpp', 'android/nsMIMEInfoAndroid.cpp', ] -@@ -133,16 +135,17 @@ include('/ipc/chromium/chromium-config.m +@@ -135,16 +137,17 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' LOCAL_INCLUDES += [ @@ -974,7 +974,7 @@ new file mode 100644 --- /dev/null +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp -@@ -0,0 +1,87 @@ +@@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -985,7 +985,6 @@ +#include "prmem.h" +#include "nsString.h" +#include "nsMIMEInfoUnix.h" -+#include "nsAutoPtr.h" +#include "nsKDEUtils.h" + +/* static */ bool @@ -1104,7 +1103,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp -@@ -1,47 +1,50 @@ +@@ -1,46 +1,49 @@ /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public @@ -1117,7 +1116,6 @@ #include "nsIGIOService.h" #include "nsNetCID.h" #include "nsIIOService.h" - #include "nsAutoPtr.h" #ifdef MOZ_ENABLE_DBUS # include "nsDBusHandlerApp.h" #endif @@ -1160,7 +1158,7 @@ if (*_retval) return NS_OK; return NS_OK; -@@ -51,16 +54,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi +@@ -50,16 +53,33 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi // if mDefaultApplication is set, it means the application has been set from // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to // give the GNOME answer. @@ -1213,10 +1211,10 @@ #include "nsString.h" #include "nsReadableUtils.h" #include "nsUnicharUtils.h" - #include "nsIURL.h" #include "nsIFileStreams.h" #include "nsILineInputStream.h" -@@ -1025,17 +1025,17 @@ nsresult nsOSHelperAppService::GetHandle + #include "nsIFile.h" +@@ -1023,17 +1023,17 @@ nsresult nsOSHelperAppService::GetHandle nsresult nsOSHelperAppService::OSProtocolHandlerExists( const char* aProtocolScheme, bool* aHandlerExists) { @@ -1235,7 +1233,7 @@ nsCOMPtr handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv); if (NS_SUCCEEDED(rv) && handlerSvc) { -@@ -1045,17 +1045,17 @@ nsresult nsOSHelperAppService::OSProtoco +@@ -1043,17 +1043,17 @@ nsresult nsOSHelperAppService::OSProtoco } return rv; @@ -1252,9 +1250,9 @@ #endif } - nsresult nsOSHelperAppService::GetFileTokenForPath( - const char16_t* platformAppPath, nsIFile** aFile) { -@@ -1136,17 +1136,17 @@ already_AddRefed nsOSHel + NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol( + const nsACString& aScheme, bool* _retval) { +@@ -1140,17 +1140,17 @@ already_AddRefed nsOSHel nsresult rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, true); @@ -1273,7 +1271,7 @@ rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, false); -@@ -1248,17 +1248,17 @@ already_AddRefed nsOSHel +@@ -1252,17 +1252,17 @@ already_AddRefed nsOSHel // Now look up our extensions nsAutoString extensions, mime_types_description; @@ -1295,7 +1293,7 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -126,16 +126,17 @@ include('/ipc/chromium/chromium-config.m +@@ -129,16 +129,17 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' @@ -1316,25 +1314,24 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp -@@ -4,16 +4,17 @@ +@@ -1,15 +1,16 @@ + /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - #include "mozilla/Types.h" + #include + #include ++#include #include #include #include - #include -+#include - + #include "mozilla/Types.h" #include "nsGtkUtils.h" #include "nsIFileURL.h" #include "nsIGIOService.h" - #include "nsIURI.h" - #include "nsIWidget.h" - #include "nsIFile.h" - #include "nsIStringBundle.h" -@@ -21,16 +22,17 @@ +@@ -20,16 +21,18 @@ #include "nsArrayEnumerator.h" #include "nsMemory.h" #include "nsEnumeratorUtils.h" @@ -1344,6 +1341,7 @@ #include "nsFilePicker.h" +#include "nsKDEUtils.h" ++#include "nsURLHelper.h" using namespace mozilla; @@ -1352,7 +1350,7 @@ #define MAX_PREVIEW_SOURCE_SIZE 4096 nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; -@@ -228,17 +230,19 @@ nsFilePicker::AppendFilters(int32_t aFil +@@ -223,17 +226,19 @@ nsFilePicker::AppendFilters(int32_t aFil mAllowURLs = !!(aFilterMask & filterAllowURLs); return nsBaseFilePicker::AppendFilters(aFilterMask); } @@ -1373,7 +1371,7 @@ mFilters.AppendElement(filter); mFilterNames.AppendElement(name); -@@ -338,16 +342,39 @@ nsresult nsFilePicker::Show(int16_t* aRe +@@ -333,16 +338,39 @@ nsresult nsFilePicker::Show(int16_t* aRe return NS_OK; } @@ -1405,15 +1403,15 @@ + return NS_OK; + } + - nsCString title; - title.Adopt(ToNewUTF8String(mTitle)); + NS_ConvertUTF16toUTF8 title(mTitle); GtkWindow* parent_widget = GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); GtkFileChooserAction action = GetGtkFileChooserAction(mMode); -@@ -573,16 +600,240 @@ void nsFilePicker::Done(void* file_choos + const gchar* accept_button; +@@ -562,16 +590,244 @@ void nsFilePicker::Done(void* file_choos mCallback->Done(result); mCallback = nullptr; } else { @@ -1579,8 +1577,12 @@ + mFileURL = output[ 0 ]; + else // GetFile() actually requires it to be url even for local files :-/ + { -+ mFileURL = nsCString( "file://" ); -+ mFileURL.Append( output[ 0 ] ); ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile( output[ 0 ], ++ PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) ++ rv = net_GetURLSpecFromActualFile(localfile, mFileURL); + } + } + // Remember last used directory. @@ -1814,7 +1816,7 @@ diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build --- a/xpcom/components/moz.build +++ b/xpcom/components/moz.build -@@ -66,16 +66,17 @@ LOCAL_INCLUDES += [ +@@ -62,16 +62,17 @@ LOCAL_INCLUDES += [ '!..', '../base', '../build', @@ -1828,14 +1830,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk': CXXFLAGS += CONFIG['TK_CFLAGS'] + if CONFIG['MOZ_ENABLE_DBUS']: + CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS'] if CONFIG['MOZ_LAYOUT_DEBUGGER']: - DEFINES['MOZ_LAYOUT_DEBUGGER'] = True - diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp -@@ -47,16 +47,17 @@ +@@ -46,16 +46,17 @@ #include "prproces.h" #include "nsIDirectoryEnumerator.h" #include "nsSimpleEnumerator.h" @@ -1853,7 +1855,7 @@ # include "prmem.h" # include "plbase64.h" -@@ -1902,62 +1903,77 @@ nsLocalFile::SetPersistentDescriptor(con +@@ -1907,62 +1908,77 @@ nsLocalFile::SetPersistentDescriptor(con NS_IMETHODIMP nsLocalFile::Reveal() {