--- a/mozilla-kde.patch Mon Aug 01 14:45:11 2016 +0200
+++ b/mozilla-kde.patch Wed Jan 18 22:06:23 2017 +0100
@@ -1,5 +1,5 @@
# HG changeset patch
-# Parent 972c67cdd5dd4463abbee60036b686d4cb78e616
+# Parent 6ff55468281e12a84adefb46b17acb60d9cea608
Description: Add KDE integration to Firefox (toolkit parts)
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
Author: Lubos Lunak <lunak@suse.com>
@@ -27,7 +27,7 @@
#include "prefread.h"
#include "prefapi_private_data.h"
-@@ -1145,16 +1146,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
+@@ -1180,16 +1181,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
static nsresult pref_LoadPrefsInDirList(const char *listId)
{
@@ -62,7 +62,7 @@
return NS_OK;
bool hasMore;
-@@ -1170,17 +1189,17 @@ static nsresult pref_LoadPrefsInDirList(
+@@ -1205,17 +1224,17 @@ static nsresult pref_LoadPrefsInDirList(
nsAutoCString leaf;
path->GetNativeLeafName(leaf);
@@ -81,7 +81,7 @@
{
nsZipItemPtr<char> manifest(jarReader, name, true);
NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
-@@ -1274,24 +1293,36 @@ static nsresult pref_InitInitialObjects(
+@@ -1309,24 +1328,36 @@ static nsresult pref_InitInitialObjects(
/* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
static const char* specialFiles[] = {
#if defined(XP_MACOSX)
@@ -141,7 +141,7 @@
DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
- if CONFIG['GNU_CXX']:
+ FINAL_TARGET_PP_FILES += [
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
--- a/python/mozbuild/mozpack/chrome/flags.py
+++ b/python/mozbuild/mozpack/chrome/flags.py
@@ -187,7 +187,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
-@@ -60,15 +60,16 @@ if not CONFIG['MOZ_SUITE']:
+@@ -60,17 +60,18 @@ if not CONFIG['MOZ_SUITE']:
'nsDownloadManagerUI.js',
'nsDownloadManagerUI.manifest',
]
@@ -205,6 +205,8 @@
DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
CXXFLAGS += CONFIG['TK_CFLAGS']
+
+ if CONFIG['GNU_CXX']:
diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -226,7 +228,7 @@
#endif
#ifdef MOZ_WIDGET_ANDROID
- #include "AndroidBridge.h"
+ #include "GeneratedJNIWrappers.h"
#endif
@@ -2719,16 +2723,25 @@ nsDownload::SetState(DownloadState aStat
@@ -276,7 +278,7 @@
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
-@@ -72,29 +72,33 @@ toolkit.jar:
+@@ -67,29 +67,33 @@ toolkit.jar:
content/global/viewZoomOverlay.js
content/global/bindings/autocomplete.xml (widgets/autocomplete.xml)
content/global/bindings/browser.xml (widgets/browser.xml)
@@ -782,7 +784,7 @@
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/preferences-kde.xml
-@@ -0,0 +1,1408 @@
+@@ -0,0 +1,1410 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE bindings [
@@ -952,6 +954,8 @@
+ <field name="_constructed">false</field>
+ <property name="instantApply">
+ <getter>
++ if (this.getAttribute("instantApply") == "false")
++ return false;
+ return this.getAttribute("instantApply") == "true" || this.preferences.instantApply;
+ </getter>
+ </property>
@@ -2288,13 +2292,13 @@
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
-@@ -48,17 +48,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
- elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
- EXPORTS += ['nsQAppInstance.h']
- SOURCES += [
- '!moc_nsNativeAppSupportQt.cpp',
- 'nsNativeAppSupportQt.cpp',
- 'nsQAppInstance.cpp',
+@@ -39,17 +39,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
+ 'updaterfileutils_osx.mm',
+ ]
+ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
+ UNIFIED_SOURCES += [
+ 'nsNativeAppSupportDefault.cpp',
+ 'UIKitDirProvider.mm',
]
elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+ EXPORTS += ['nsKDEUtils.h']
@@ -2708,18 +2712,18 @@
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
-@@ -75,17 +75,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
- else:
- # These files can't be built in unified mode because they redefine LOG.
+@@ -77,17 +77,19 @@ else:
SOURCES += [
osdir + '/nsOSHelperAppService.cpp',
]
+ if CONFIG['GNU_CXX']:
+ CXXFLAGS += ['-Wno-error=shadow']
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
UNIFIED_SOURCES += [
+ 'unix/nsCommonRegistry.cpp',
'unix/nsGNOMERegistry.cpp',
-+ 'unix/nsKDERegistry.cpp',
++ 'unix/nsKDERegistry.cpp',
'unix/nsMIMEInfoUnix.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
@@ -2728,7 +2732,7 @@
'android/nsExternalSharingAppService.cpp',
'android/nsExternalURLHandlerService.cpp',
'android/nsMIMEInfoAndroid.cpp',
-@@ -129,16 +131,17 @@ include('/ipc/chromium/chromium-config.m
+@@ -123,16 +125,17 @@ include('/ipc/chromium/chromium-config.m
FINAL_LIBRARY = 'xul'
@@ -2744,7 +2748,7 @@
CXXFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2', 'gtk3'):
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
new file mode 100644
@@ -2972,13 +2976,12 @@
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
-@@ -7,32 +7,35 @@
- #ifdef MOZ_WIDGET_QT
- #if (MOZ_ENABLE_CONTENTACTION)
- #include <contentaction/contentaction.h>
- #include "nsContentHandlerApp.h"
- #endif
- #endif
+@@ -1,50 +1,53 @@
+ /* -*- 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
+ * 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 "nsMIMEInfoUnix.h"
-#include "nsGNOMERegistry.h"
@@ -2990,9 +2993,6 @@
#ifdef MOZ_ENABLE_DBUS
#include "nsDBusHandlerApp.h"
#endif
- #ifdef MOZ_WIDGET_QT
- #include "nsMIMEInfoQt.h"
- #endif
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
+#include "nsKDEUtils.h"
+#endif
@@ -3000,17 +3000,14 @@
nsresult
nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
{
-- nsresult rv = nsGNOMERegistry::LoadURL(aURI);
-+ nsresult rv = nsCommonRegistry::LoadURL(aURI);
+- return nsGNOMERegistry::LoadURL(aURI);
++ return nsCommonRegistry::LoadURL(aURI);
+ }
- #ifdef MOZ_WIDGET_QT
- if (NS_FAILED(rv)) {
- rv = nsMIMEInfoQt::LoadUriInternal(aURI);
- }
- #endif
-
- return rv;
-@@ -45,24 +48,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
+ NS_IMETHODIMP
+ nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
+ {
+ // 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.
if (mDefaultApplication)
@@ -3038,7 +3035,7 @@
if (*_retval)
return NS_OK;
-@@ -97,16 +100,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
+@@ -79,16 +82,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
if (action.isValid()) {
action.trigger();
@@ -3273,8 +3270,8 @@
GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
- const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
-@@ -595,8 +615,235 @@ nsFilePicker::Done(GtkWidget* file_choos
+
+@@ -603,8 +623,235 @@ nsFilePicker::Done(GtkWidget* file_choos
if (mCallback) {
mCallback->Done(result);
mCallback = nullptr;
@@ -3588,7 +3585,7 @@
#pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
if (GetVersionEx(&info)) {
- nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
+ nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
info.dwMajorVersion,
info.dwMinorVersion);
}
@@ -3597,12 +3594,12 @@
#elif defined(MOZ_WIDGET_COCOA)
SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
- nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
+ nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
majorVersion,
minorVersion);
+ desktop = NS_LITERAL_STRING("macosx");
#elif defined(MOZ_WIDGET_GTK)
- nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
+ nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
gtk_major_version,
gtk_minor_version);
+ desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
@@ -3612,7 +3609,7 @@
mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
"RELEASE",
osVersion);
- isTablet = mozilla::widget::GeckoAppShell::IsTablet();
+ isTablet = java::GeckoAppShell::IsTablet();
}
+ desktop = NS_LITERAL_STRING("android");
#endif
@@ -3672,7 +3669,7 @@
diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
-@@ -47,12 +47,13 @@ FINAL_LIBRARY = 'xul'
+@@ -44,12 +44,13 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'!..',
'../base',