mozilla-kde.patch
changeset 659 fa96cf6ffd14
parent 653 38c67b6b2f37
child 680 be770d3cbc02
--- a/mozilla-kde.patch	Mon Jun 17 22:57:16 2013 +0200
+++ b/mozilla-kde.patch	Tue Jul 16 12:35:11 2013 +0200
@@ -7,7 +7,7 @@
 diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in
 --- a/modules/libpref/src/Makefile.in
 +++ b/modules/libpref/src/Makefile.in
-@@ -56,14 +56,15 @@ endif
+@@ -49,14 +49,15 @@ endif
  # Optimizer bug with GCC 3.2.2 on OS/2
  ifeq ($(OS_ARCH), OS2)
  nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp
@@ -44,7 +44,7 @@
  #include "prefread.h"
  #include "prefapi_private_data.h"
  
-@@ -966,16 +967,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
+@@ -972,16 +973,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
  
  static nsresult pref_LoadPrefsInDirList(const char *listId)
  {
@@ -79,7 +79,7 @@
      return NS_OK;
  
    bool hasMore;
-@@ -991,17 +1010,17 @@ static nsresult pref_LoadPrefsInDirList(
+@@ -997,17 +1016,17 @@ static nsresult pref_LoadPrefsInDirList(
  
      nsAutoCString leaf;
      path->GetNativeLeafName(leaf);
@@ -98,7 +98,7 @@
  {
    nsZipItemPtr<char> manifest(jarReader, name, true);
    NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
-@@ -1095,28 +1114,40 @@ static nsresult pref_InitInitialObjects(
+@@ -1101,28 +1120,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)
@@ -184,8 +184,8 @@
 diff --git a/toolkit/components/downloads/Makefile.in b/toolkit/components/downloads/Makefile.in
 --- a/toolkit/components/downloads/Makefile.in
 +++ b/toolkit/components/downloads/Makefile.in
-@@ -32,9 +32,11 @@ ifndef MOZ_SUITE
- EXTRA_COMPONENTS = \
+@@ -23,9 +23,11 @@ ifndef MOZ_SUITE
+ DISABLED_EXTRA_COMPONENTS = \
    nsDownloadManagerUI.js \
    nsDownloadManagerUI.manifest \
    $(NULL)
@@ -220,7 +220,7 @@
  #include "AndroidBridge.h"
  #endif
  
-@@ -2603,16 +2607,25 @@ nsDownload::SetState(DownloadState aStat
+@@ -2609,16 +2613,25 @@ nsDownload::SetState(DownloadState aStat
        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
  
        // Master pref to control this function.
@@ -246,7 +246,7 @@
          int64_t goat = PR_Now() - mStartTime;
          showTaskbarAlert = goat > alertIntervalUSec;
  
-@@ -2639,19 +2652,20 @@ nsDownload::SetState(DownloadState aStat
+@@ -2645,19 +2658,20 @@ nsDownload::SetState(DownloadState aStat
                // retention policy, there's no reason to make the text clickable
                // because if it is, they'll click open the download manager and
                // the items they downloaded will have been removed.
@@ -2200,29 +2200,30 @@
 +  return NS_OK;
 +}
 +
-diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in
---- a/toolkit/xre/Makefile.in
-+++ b/toolkit/xre/Makefile.in
-@@ -60,17 +60,18 @@ DEFINES += -DWIN32_LEAN_AND_MEAN -DUNICO
- else
- ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
- CMMSRCS = nsNativeAppSupportCocoa.mm
- else
- ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
- CPPSRCS += nsNativeAppSupportOS2.cpp
- else
- ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
--CPPSRCS += nsNativeAppSupportUnix.cpp
-+CPPSRCS += nsNativeAppSupportUnix.cpp nsKDEUtils.cpp
-+EXPORTS += nsKDEUtils.h
- else
- ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
- MOCSRCS += moc_nsNativeAppSupportQt.cpp
- CPPSRCS += $(MOCSRCS)
- CPPSRCS += nsNativeAppSupportQt.cpp
- CPPSRCS += nsQAppInstance.cpp
- else
- CPPSRCS += nsNativeAppSupportDefault.cpp
+diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
+--- a/toolkit/xre/moz.build
++++ b/toolkit/xre/moz.build
+@@ -38,18 +38,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt
+         'nsNativeAppSupportQt.cpp',
+         'nsQAppInstance.cpp',
+     ]
+ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'os2':
+     CPP_SOURCES += [
+         'nsNativeAppSupportOS2.cpp',
+     ]
+ elif CONFIG['MOZ_ENABLE_GTK']:
++    EXPORTS += ['nsKDEUtils.h']
+     CPP_SOURCES += [
+         'nsNativeAppSupportUnix.cpp',
++	'nsKDEUtils.cpp'
+     ]
+ else:
+     CPP_SOURCES += [
+         'nsNativeAppSupportDefault.cpp',
+     ]
+ 
+ if CONFIG['MOZ_X11']:
+     CPP_SOURCES += [
 diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
 new file mode 100644
 --- /dev/null
@@ -2623,27 +2624,39 @@
 diff --git a/uriloader/exthandler/Makefile.in b/uriloader/exthandler/Makefile.in
 --- a/uriloader/exthandler/Makefile.in
 +++ b/uriloader/exthandler/Makefile.in
-@@ -53,18 +53,19 @@ LOCAL_INCLUDES = -I$(srcdir)
- LOCAL_INCLUDES += -I$(topsrcdir)/dom/base \
-             -I$(topsrcdir)/dom/ipc \
-             -I$(topsrcdir)/content/base/src \
-             -I$(topsrcdir)/content/events/src \
-             -I$(topsrcdir)/netwerk/base/src \
-             -I$(topsrcdir)/netwerk/protocol/http
+@@ -86,9 +86,10 @@ EXTRA_COMPONENTS = \
+ # we don't want the shared lib, but we want to force the creation of a static lib.
+ FORCE_STATIC_LIB = 1
+ include $(topsrcdir)/config/config.mk
+ include $(topsrcdir)/ipc/chromium/chromium-config.mk
+ include $(topsrcdir)/config/rules.mk
  
- ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
--OSHELPER	+= nsGNOMERegistry.cpp
-+OSHELPER	+= nsCommonRegistry.cpp nsGNOMERegistry.cpp nsKDERegistry.cpp
- OSHELPER  += nsMIMEInfoUnix.cpp
+ ifneq (,$(filter qt gtk2 gtk3, $(MOZ_WIDGET_TOOLKIT)))
+ CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
  endif
+diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
+--- a/uriloader/exthandler/moz.build
++++ b/uriloader/exthandler/moz.build
+@@ -68,16 +68,18 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
+     pass
+ else:
+     CPP_SOURCES += [
+         'nsOSHelperAppService.cpp',
+     ]
  
- ifeq ($(MOZ_WIDGET_TOOLKIT),android)
- OSHELPER += nsMIMEInfoAndroid.cpp
- OSHELPER += nsAndroidHandlerApp.cpp
- OSHELPER += nsExternalSharingAppService.cpp
- OSHELPER += nsExternalURLHandlerService.cpp
- endif
+ if CONFIG['MOZ_ENABLE_GTK']:
+     CPP_SOURCES += [
++        'nsCommonRegistry.cpp',
++	'nsKDERegistry.cpp',
+         'nsGNOMERegistry.cpp',
+         'nsMIMEInfoUnix.cpp',
+     ]
+ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
+     CPP_SOURCES += [
+         'nsMIMEInfoAndroid.cpp',
+         'nsAndroidHandlerApp.cpp',
+         'nsExternalSharingAppService.cpp',
 diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
 new file mode 100644
 --- /dev/null
@@ -2735,7 +2748,7 @@
 new file mode 100644
 --- /dev/null
 +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp
-@@ -0,0 +1,90 @@
+@@ -0,0 +1,88 @@
 +/* -*- 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
@@ -2820,9 +2833,7 @@
 +        nsCString handlerAppName = output[ 2 ];
 +        mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName));
 +        mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
-+        nsMIMEInfoBase* retval;
-+        NS_ADDREF((retval = mimeInfo));
-+        return retval;
++        return mimeInfo.forget();
 +        }
 +    return nullptr;
 +}
@@ -2988,7 +2999,7 @@
  
  #include "nsOSHelperAppService.h"
  #include "nsMIMEInfoUnix.h"
- #ifdef MOZ_WIDGET_GTK2
+ #ifdef MOZ_WIDGET_GTK
 -#include "nsGNOMERegistry.h"
 +#include "nsCommonRegistry.h"
  #endif
@@ -3006,7 +3017,7 @@
      *aHandlerExists = true;
  #endif
  
- #ifdef MOZ_WIDGET_GTK2
+ #ifdef MOZ_WIDGET_GTK
    // Check the GConf registry for a protocol handler
 -  *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
 +  *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme);
@@ -3020,7 +3031,7 @@
  
  NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval)
  {
- #ifdef MOZ_WIDGET_GTK2
+ #ifdef MOZ_WIDGET_GTK
 -  nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval);
 +  nsCommonRegistry::GetAppDescForScheme(aScheme, _retval);
    return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
@@ -3037,7 +3048,7 @@
  
    if (NS_FAILED(rv) || majorType.IsEmpty()) {
      
- #ifdef MOZ_WIDGET_GTK2
+ #ifdef MOZ_WIDGET_GTK
      LOG(("Looking in GNOME registry\n"));
      nsRefPtr<nsMIMEInfoBase> gnomeInfo =
 -      nsGNOMERegistry::GetFromExtension(aFileExt);
@@ -3051,7 +3062,7 @@
      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
                                    majorType,
 @@ -1389,17 +1389,17 @@ nsOSHelperAppService::GetFromType(const 
- #ifdef MOZ_WIDGET_GTK2
+ #ifdef MOZ_WIDGET_GTK
    nsRefPtr<nsMIMEInfoBase> gnomeInfo;
    if (handler.IsEmpty()) {
      // No useful data yet.  Check the GNOME registry.  Unfortunately, newer
@@ -3072,7 +3083,7 @@
 diff --git a/widget/gtk2/Makefile.in b/widget/gtk2/Makefile.in
 --- a/widget/gtk2/Makefile.in
 +++ b/widget/gtk2/Makefile.in
-@@ -96,11 +96,14 @@ DEFINES		+= -DCAIRO_GFX -DMOZ_APP_NAME='
+@@ -67,11 +67,14 @@ DEFINES		+= -DCAIRO_GFX -DMOZ_APP_NAME='
  
  INCLUDES	+= \
  		-I$(srcdir)/../xpwidgets \
@@ -3124,7 +3135,7 @@
  using namespace mozilla;
  
  #define MAX_PREVIEW_SIZE 180
-@@ -236,17 +238,19 @@ nsFilePicker::AppendFilters(int32_t aFil
+@@ -242,17 +244,19 @@ nsFilePicker::AppendFilters(int32_t aFil
    return nsBaseFilePicker::AppendFilters(aFilterMask);
  }
  
@@ -3145,7 +3156,7 @@
  
    mFilters.AppendElement(filter);
    mFilterNames.AppendElement(name);
-@@ -360,16 +364,32 @@ nsFilePicker::Show(int16_t *aReturn)
+@@ -366,16 +370,32 @@ nsFilePicker::Show(int16_t *aReturn)
  
  NS_IMETHODIMP
  nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
@@ -3178,7 +3189,7 @@
  
    GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
    const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
-@@ -561,8 +581,235 @@ nsFilePicker::Done(GtkWidget* file_choos
+@@ -567,8 +587,235 @@ nsFilePicker::Done(GtkWidget* file_choos
    if (mCallback) {
      mCallback->Done(result);
      mCallback = nullptr;
@@ -3438,17 +3449,16 @@
 diff --git a/xpcom/components/Makefile.in b/xpcom/components/Makefile.in
 --- a/xpcom/components/Makefile.in
 +++ b/xpcom/components/Makefile.in
-@@ -34,10 +34,11 @@ LOCAL_INCLUDES	= \
- # we don't want the shared lib, but we want to force the creation of a static lib.
+@@ -28,9 +28,10 @@ LOCAL_INCLUDES	= \
  FORCE_STATIC_LIB = 1
  
  include $(topsrcdir)/config/rules.mk
  
  DEFINES	+= -D_IMPL_NS_COM
  
- ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ ifdef MOZ_WIDGET_GTK
+ CXXFLAGS        += $(TK_CFLAGS)
 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
- CXXFLAGS += $(MOZ_GTK2_CFLAGS)
  endif
 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
 --- a/xpcom/components/ManifestParser.cpp
@@ -3516,7 +3526,7 @@
                                           minorVersion);
    }
 +  desktop = NS_LITERAL_STRING("macosx");
- #elif defined(MOZ_WIDGET_GTK2)
+ #elif defined(MOZ_WIDGET_GTK)
    nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
                                         gtk_major_version,
                                         gtk_minor_version);
@@ -3584,7 +3594,7 @@
 diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in
 --- a/xpcom/io/Makefile.in
 +++ b/xpcom/io/Makefile.in
-@@ -77,17 +77,17 @@ include $(topsrcdir)/ipc/chromium/chromi
+@@ -43,17 +43,17 @@ include $(topsrcdir)/ipc/chromium/chromi
  DEFINES		+= -D_IMPL_NS_COM
  
  ifeq ($(OS_ARCH),Linux)
@@ -3624,7 +3634,7 @@
  #include "prmem.h"
  #include "plbase64.h"
  
-@@ -1752,44 +1753,51 @@ nsLocalFile::SetPersistentDescriptor(con
+@@ -1753,44 +1754,51 @@ nsLocalFile::SetPersistentDescriptor(con
      return InitWithNativePath(aPersistentDescriptor);
  #endif
  }
@@ -3690,7 +3700,7 @@
        return rv;
      }
      return NS_ERROR_FAILURE;
-@@ -1815,16 +1823,23 @@ nsLocalFile::Launch()
+@@ -1816,16 +1824,23 @@ nsLocalFile::Launch()
  
      if (nullptr == connection)
        return NS_ERROR_FAILURE;