--- a/mozilla-kde.patch Sun Apr 13 16:54:09 2014 +0200
+++ b/mozilla-kde.patch Mon Apr 14 09:09:11 2014 +0200
@@ -44,7 +44,7 @@
#include "prefread.h"
#include "prefapi_private_data.h"
-@@ -1115,16 +1116,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
+@@ -1113,16 +1114,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
static nsresult pref_LoadPrefsInDirList(const char *listId)
{
@@ -62,7 +62,7 @@
+
+ if (nsKDEUtils::kdeSession()) {
+ for(int i = 0;
-+ i < NS_ARRAY_LENGTH(specialFiles);
++ i < MOZ_ARRAY_LENGTH(specialFiles);
+ ++i ) {
+ if (*specialFiles[ i ] == '\0') {
+ specialFiles[ i ] = "kde.js";
@@ -79,7 +79,7 @@
return NS_OK;
bool hasMore;
-@@ -1140,17 +1159,17 @@ static nsresult pref_LoadPrefsInDirList(
+@@ -1138,17 +1157,17 @@ static nsresult pref_LoadPrefsInDirList(
nsAutoCString leaf;
path->GetNativeLeafName(leaf);
@@ -89,7 +89,7 @@
ReadExtensionPrefs(path);
else
- pref_LoadPrefsInDir(path, nullptr, 0);
-+ pref_LoadPrefsInDir(path, specialFiles, NS_ARRAY_LENGTH(specialFiles));
++ pref_LoadPrefsInDir(path, specialFiles, MOZ_ARRAY_LENGTH(specialFiles));
}
return NS_OK;
}
@@ -98,7 +98,7 @@
{
nsZipItemPtr<char> manifest(jarReader, name, true);
NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
-@@ -1244,28 +1263,40 @@ static nsresult pref_InitInitialObjects(
+@@ -1242,28 +1261,40 @@ 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)
@@ -122,7 +122,7 @@
+ if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
+ for(int i = 0;
-+ i < NS_ARRAY_LENGTH(specialFiles);
++ i < MOZ_ARRAY_LENGTH(specialFiles);
+ ++i ) {
+ if( *specialFiles[ i ] == '\0' ) {
+ specialFiles[ i ] = "kde.js";
@@ -270,7 +270,7 @@
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
-@@ -53,29 +53,33 @@ toolkit.jar:
+@@ -55,29 +55,33 @@ toolkit.jar:
content/global/viewZoomOverlay.js (viewZoomOverlay.js)
*+ content/global/bindings/autocomplete.xml (widgets/autocomplete.xml)
content/global/bindings/browser.xml (widgets/browser.xml)
@@ -764,7 +764,7 @@
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/preferences-kde.xml
-@@ -0,0 +1,1332 @@
+@@ -0,0 +1,1334 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE bindings [
@@ -1350,15 +1350,14 @@
+ <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
+ <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
+#elif XP_UNIX
-+ pack="end">
-+ <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
-+ <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
-+ <xul:spacer anonid="spacer" flex="1"/>
-+ <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
-+ <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
-+ <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
-+ <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
-+
++ pack="end">
++ <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
++ <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
++ <xul:spacer anonid="spacer" flex="1"/>
++ <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
++ <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
++ <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
++ <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
+#else
+ pack="end">
+ <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
@@ -1808,9 +1807,10 @@
+ <handlers>
+ <handler event="dialogaccept">
+ <![CDATA[
-+ if (!this._fireEvent("beforeaccept", this))
-+ return;
-+
++ if (!this._fireEvent("beforeaccept", this)){
++ return false;
++ }
++
+ if (this.type == "child" && window.opener) {
+ var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranch);
@@ -1873,6 +1873,8 @@
+ .getService(Components.interfaces.nsIPrefService);
+ psvc.savePrefFile(null);
+ }
++
++ return true;
+ ]]>
+ </handler>
+ <handler event="command">
@@ -2617,7 +2619,7 @@
+++ b/uriloader/exthandler/Makefile.in
@@ -19,9 +19,10 @@ endif
ifdef MOZ_ENABLE_DBUS
- LOCAL_INCLUDES += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS)
+ OS_INCLUDES += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS)
endif
include $(topsrcdir)/config/rules.mk
@@ -3029,7 +3031,7 @@
#endif
}
- nsresult nsOSHelperAppService::GetFileTokenForPath(const PRUnichar * platformAppPath, nsIFile ** aFile)
+ nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile)
{
@@ -1263,17 +1263,17 @@ nsOSHelperAppService::GetFromExtension(c
mime_types_description,
@@ -3072,14 +3074,14 @@
diff --git a/widget/gtk/Makefile.in b/widget/gtk/Makefile.in
--- a/widget/gtk/Makefile.in
+++ b/widget/gtk/Makefile.in
-@@ -4,11 +4,13 @@
+@@ -3,11 +3,13 @@
+ # 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 $(topsrcdir)/config/rules.mk
CFLAGS += $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
- CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS) \
- $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
+ CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
+
@@ -3452,7 +3454,7 @@
diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
-@@ -30,16 +30,17 @@
+@@ -31,16 +31,17 @@
#include "nsTextFormatter.h"
#include "nsVersionComparator.h"
#include "nsXPCOMCIDInternal.h"
@@ -3470,7 +3472,7 @@
const char* directive;
int argc;
-@@ -397,16 +398,17 @@ ParseManifest(NSLocationType type, FileL
+@@ -398,16 +399,17 @@ ParseManifest(NSLocationType type, FileL
NS_NAMED_LITERAL_STRING(kPlatform, "platform");
NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
NS_NAMED_LITERAL_STRING(kApplication, "application");
@@ -3488,9 +3490,9 @@
NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers");
nsAutoString appID;
-@@ -444,41 +446,46 @@ ParseManifest(NSLocationType type, FileL
+@@ -445,42 +447,47 @@ ParseManifest(NSLocationType type, FileL
CopyUTF8toUTF16(s, abi);
- abi.Insert(PRUnichar('_'), 0);
+ abi.Insert(char16_t('_'), 0);
abi.Insert(osTarget, 0);
}
}
@@ -3499,24 +3501,25 @@
nsAutoString osVersion;
+ nsAutoString desktop;
#if defined(XP_WIN)
+ #pragma warning(push)
+ #pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
if (GetVersionEx(&info)) {
- nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
+ nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
info.dwMajorVersion,
info.dwMinorVersion);
}
+ desktop = NS_LITERAL_STRING("win");
+ #pragma warning(pop)
#elif defined(MOZ_WIDGET_COCOA)
- SInt32 majorVersion, minorVersion;
- if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) &&
- (Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr)) {
- nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
- majorVersion,
- minorVersion);
- }
+ SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
+ SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
+ nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
+ majorVersion,
+ minorVersion);
+ desktop = NS_LITERAL_STRING("macosx");
#elif defined(MOZ_WIDGET_GTK)
- nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
+ nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
gtk_major_version,
gtk_minor_version);
+ desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
@@ -3535,7 +3538,7 @@
char *token;
char *newline = buf;
-@@ -560,24 +567,26 @@ ParseManifest(NSLocationType type, FileL
+@@ -562,24 +569,26 @@ ParseManifest(NSLocationType type, FileL
TriState stOsVersion = eUnspecified;
TriState stOs = eUnspecified;
TriState stABI = eUnspecified;
@@ -3562,7 +3565,7 @@
#if defined(MOZ_WIDGET_ANDROID)
bool tablet = false;
if (CheckFlag(kTablet, wtoken, tablet)) {
-@@ -606,16 +615,17 @@ ParseManifest(NSLocationType type, FileL
+@@ -608,16 +617,17 @@ ParseManifest(NSLocationType type, FileL
}
if (!ok ||