mozilla-kde.patch
changeset 340 aabcc7895695
parent 294 5330447b83a3
child 356 30a00f382aed
--- a/mozilla-kde.patch	Wed Oct 05 13:40:30 2011 +0200
+++ b/mozilla-kde.patch	Wed Oct 05 16:01:57 2011 +0200
@@ -39,7 +39,7 @@
  #include "prefapi.h"
  #include "prefread.h"
  #include "prefapi_private_data.h"
-@@ -966,30 +967,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
+@@ -956,30 +957,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
  }
  
  static nsresult pref_LoadPrefsInDirList(const char *listId)
@@ -89,51 +89,51 @@
  }
  
  static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
-@@ -1082,28 +1101,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[] = {
+@@ -1072,28 +1091,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)
-       "macprefs.js"
+     "macprefs.js"
  #elif defined(XP_WIN)
-       "winpref.js"
+     "winpref.js"
  #elif defined(XP_UNIX)
-       "unix.js"
-+      , "" // placeholder for KDE  (empty is otherwise harmless)
+     "unix.js"
++    , "" // placeholder for KDE  (empty is otherwise harmless)
  #if defined(VMS)
-       , "openvms.js"
+     , "openvms.js"
  #elif defined(_AIX)
-       , "aix.js"
+     , "aix.js"
  #endif
  #elif defined(XP_OS2)
-       "os2pref.js"
+     "os2pref.js"
  #elif defined(XP_BEOS)
-       "beos.js"
+     "beos.js"
  #endif
-     };
+   };
  
-+    if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
-+      for( int i = 0;
-+          i < NS_ARRAY_LENGTH(specialFiles);
-+          ++i ) {
-+        if( *specialFiles[ i ] == '\0' ) {
-+          specialFiles[ i ] = "kde.js";
-+          break;
-+        }
++  if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
++    for( int i = 0;
++        i < NS_ARRAY_LENGTH(specialFiles);
++        ++i ) {
++      if( *specialFiles[ i ] == '\0' ) {
++        specialFiles[ i ] = "kde.js";
++        break;
 +      }
 +    }
++  }
 +
-     rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
-     if (NS_FAILED(rv))
-       NS_WARNING("Error parsing application default preferences.");
-   }
+   rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
+   if (NS_FAILED(rv))
+     NS_WARNING("Error parsing application default preferences.");
  
    // Load jar:$app/omni.jar!/defaults/preferences/*.js
    nsZipArchive *appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
    if (appJarReader) {
+     rv = appJarReader->FindInit("defaults/preferences/*.js$", &findPtr);
 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
-@@ -77,8 +77,10 @@ EXTRA_COMPONENTS = \
+@@ -75,8 +75,10 @@ EXTRA_COMPONENTS = \
    $(NULL)
  endif
  
@@ -2178,7 +2178,7 @@
 diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in
 --- a/toolkit/xre/Makefile.in
 +++ b/toolkit/xre/Makefile.in
-@@ -98,17 +98,18 @@ EXPORTS = nsWindowsDllInterceptor.h
+@@ -94,17 +94,18 @@ EXPORTS = nsWindowsDllInterceptor.h
  else
  ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
  CMMSRCS = nsNativeAppSupportCocoa.mm
@@ -3192,13 +3192,13 @@
 diff --git a/widget/src/gtk2/Makefile.in b/widget/src/gtk2/Makefile.in
 --- a/widget/src/gtk2/Makefile.in
 +++ b/widget/src/gtk2/Makefile.in
-@@ -134,11 +134,14 @@ endif
- 
- DEFINES		+= -DCAIRO_GFX
+@@ -135,11 +135,14 @@ DEFINES		+= -DCAIRO_GFX
  
  INCLUDES	+= \
  		-I$(srcdir)/../xpwidgets \
  		-I$(srcdir)/../shared \
+ 		-I$(topsrcdir)/layout/generic \
+ 		-I$(topsrcdir)/layout/xul/base/src \
  		-I$(topsrcdir)/other-licenses/atk-1.0 \
  		$(NULL)
 +
@@ -3228,7 +3228,8 @@
  #include "nsIStringBundle.h"
  
  #include "nsArrayEnumerator.h"
-@@ -50,16 +51,17 @@
+@@ -49,16 +50,17 @@
+ #include "nsNetUtil.h"
  #include "nsReadableUtils.h"
  #include "mozcontainer.h"
  
@@ -3236,7 +3237,6 @@
  #include "prlink.h"
  
  #include "nsFilePicker.h"
- #include "nsAccessibilityHelper.h"
 +#include "nsKDEUtils.h"
  
  #if (MOZ_PLATFORM_MAEMO == 5)
@@ -3246,7 +3246,7 @@
  #define MAX_PREVIEW_SIZE 180
  
  nsILocalFile *nsFilePicker::mPrevDisplayDirectory = nsnull;
-@@ -282,17 +284,19 @@ nsFilePicker::AppendFilters(PRInt32 aFil
+@@ -281,17 +283,19 @@ nsFilePicker::AppendFilters(PRInt32 aFil
    return nsBaseFilePicker::AppendFilters(aFilterMask);
  }
  
@@ -3267,7 +3267,7 @@
  
    mFilters.AppendElement(filter);
    mFilterNames.AppendElement(name);
-@@ -430,16 +434,19 @@ confirm_overwrite_file(GtkWidget *parent
+@@ -429,16 +433,19 @@ confirm_overwrite_file(GtkWidget *parent
    gtk_widget_destroy(dialog);
  
    return result;
@@ -3287,7 +3287,7 @@
    GtkWindow *parent_widget = get_gtk_window_for_nsiwidget(mParentWidget);
  
    GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
-@@ -580,8 +587,234 @@ nsFilePicker::Show(PRInt16 *aReturn)
+@@ -579,8 +586,234 @@ nsFilePicker::Show(PRInt16 *aReturn)
      *aReturn = nsIFilePicker::returnCancel;
      break;
    }
@@ -3561,7 +3561,7 @@
 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
 --- a/xpcom/components/ManifestParser.cpp
 +++ b/xpcom/components/ManifestParser.cpp
-@@ -59,16 +59,17 @@
+@@ -60,16 +60,17 @@
  #include "nsTextFormatter.h"
  #include "nsVersionComparator.h"
  #include "nsXPCOMCIDInternal.h"
@@ -3579,12 +3579,12 @@
  
    // Some directives should only be delivered for NS_COMPONENT_LOCATION
    // manifests.
-@@ -426,16 +427,17 @@ ParseManifestCommon(NSLocationType aType
- 
+@@ -430,16 +431,17 @@ ParseManifestCommon(NSLocationType aType
    NS_NAMED_LITERAL_STRING(kPlatform, "platform");
    NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
    NS_NAMED_LITERAL_STRING(kApplication, "application");
    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
+   NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
    NS_NAMED_LITERAL_STRING(kOs, "os");
    NS_NAMED_LITERAL_STRING(kOsVersion, "osversion");
    NS_NAMED_LITERAL_STRING(kABI, "abi");
@@ -3595,9 +3595,9 @@
  
    nsAutoString appID;
    nsAutoString appVersion;
+   nsAutoString geckoVersion;
    nsAutoString osTarget;
-   nsAutoString abi;
-@@ -465,39 +467,44 @@ ParseManifestCommon(NSLocationType aType
+@@ -474,39 +476,44 @@ ParseManifestCommon(NSLocationType aType
          CopyUTF8toUTF16(s, abi);
          abi.Insert(PRUnichar('_'), 0);
          abi.Insert(osTarget, 0);
@@ -3642,9 +3642,9 @@
  
    char *token;
    char *newline = buf;
-@@ -566,24 +573,26 @@ ParseManifestCommon(NSLocationType aType
-     bool ok = true;
+@@ -585,24 +592,26 @@ ParseManifestCommon(NSLocationType aType
      TriState stAppVersion = eUnspecified;
+     TriState stGeckoVersion = eUnspecified;
      TriState stApp = eUnspecified;
      TriState stOsVersion = eUnspecified;
      TriState stOs = eUnspecified;
@@ -3662,20 +3662,20 @@
            CheckStringFlag(kABI, wtoken, abi, stABI) ||
 +          CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) ||
            CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
-           CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion))
+           CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
+           CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion))
          continue;
  
        if (directive->contentflags &&
            (CheckFlag(kPlatform, wtoken, platform) ||
             CheckFlag(kContentAccessible, wtoken, contentAccessible)))
-         continue;
-@@ -602,16 +611,17 @@ ParseManifestCommon(NSLocationType aType
-       ok = false;
+@@ -623,16 +632,17 @@ ParseManifestCommon(NSLocationType aType
      }
  
      if (!ok ||
          stApp == eBad ||
          stAppVersion == eBad ||
+         stGeckoVersion == eBad ||
          stOs == eBad ||
          stOsVersion == eBad ||
 +        stDesktop == eBad ||
@@ -3712,11 +3712,11 @@
 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
 --- a/xpcom/io/nsLocalFileUnix.cpp
 +++ b/xpcom/io/nsLocalFileUnix.cpp
-@@ -88,16 +88,17 @@
+@@ -87,16 +87,17 @@
+ #include "nsXPIDLString.h"
  #include "prproces.h"
  #include "nsIDirectoryEnumerator.h"
  #include "nsISimpleEnumerator.h"
- #include "nsITimelineService.h"
  
  #ifdef MOZ_WIDGET_GTK2
  #include "nsIGIOService.h"
@@ -3730,7 +3730,7 @@
  #include "prmem.h"
  #include "plbase64.h"
  
-@@ -1769,44 +1770,50 @@ nsLocalFile::SetPersistentDescriptor(con
+@@ -1785,44 +1786,50 @@ nsLocalFile::SetPersistentDescriptor(con
      return InitWithNativePath(aPersistentDescriptor);
  #endif
  }
@@ -3795,7 +3795,7 @@
        return rv;
      }
      return NS_ERROR_FAILURE;
-@@ -1832,16 +1839,23 @@ nsLocalFile::Launch()
+@@ -1848,16 +1855,23 @@ nsLocalFile::Launch()
  
      if (nsnull == connection)
        return NS_ERROR_FAILURE;