mozilla-kde.patch
changeset 289 3c0dff7ca9c4
parent 284 ccddc8555cdb
child 294 5330447b83a3
--- a/mozilla-kde.patch	Thu Jul 07 08:00:10 2011 +0200
+++ b/mozilla-kde.patch	Fri Jul 08 08:21:23 2011 +0200
@@ -1,7 +1,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
-@@ -90,14 +90,16 @@ GREPREF_FILES = $(topsrcdir)/netwerk/bas
+@@ -87,14 +87,16 @@ GREPREF_FILES = $(topsrcdir)/netwerk/bas
  # Optimizer bug with GCC 3.2.2 on OS/2
  ifeq ($(OS_ARCH), OS2)
  nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp
@@ -18,9 +18,9 @@
  
  libs:: greprefs.js
  	$(INSTALL) $^ $(DIST)/bin/
-diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp
---- a/modules/libpref/src/nsPrefService.cpp
-+++ b/modules/libpref/src/nsPrefService.cpp
+diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferences.cpp
+--- a/modules/libpref/src/Preferences.cpp
++++ b/modules/libpref/src/Preferences.cpp
 @@ -53,16 +53,17 @@
  #include "nsIStringEnumerator.h"
  #include "nsIZipReader.h"
@@ -39,7 +39,7 @@
  #include "prefapi.h"
  #include "prefread.h"
  #include "prefapi_private_data.h"
-@@ -758,30 +759,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
+@@ -822,30 +823,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
  }
  
  static nsresult pref_LoadPrefsInDirList(const char *listId)
@@ -88,44 +88,48 @@
    return NS_OK;
  }
  
- //----------------------------------------------------------------------------------------
-@@ -876,24 +895,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_MAC) || defined(XP_MACOSX)
+ static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
+@@ -938,28 +957,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"
  #elif defined(XP_WIN)
        "winpref.js"
  #elif defined(XP_UNIX)
        "unix.js"
 +      , "" // placeholder for KDE  (empty is otherwise harmless)
- #if defined(_AIX)
+ #if defined(VMS)
+       , "openvms.js"
+ #elif defined(_AIX)
        , "aix.js"
  #endif
  #elif defined(XP_OS2)
        "os2pref.js"
+ #elif defined(XP_BEOS)
+       "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.");
    }
  
-   rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST);
-   NS_ENSURE_SUCCESS(rv, rv);
- 
+   // Load jar:$app/omni.jar!/defaults/preferences/*.js
+   nsZipArchive *appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
+   if (appJarReader) {
 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
@@ -145,7 +149,7 @@
 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
 @@ -71,16 +71,20 @@
  
- #if defined(XP_WIN) && !defined(WINCE)
+ #ifdef XP_WIN
  #include <shlobj.h>
  #ifdef DOWNLOAD_SCANNER
  #include "nsDownloadScanner.h"
@@ -164,7 +168,7 @@
  #include "AndroidBridge.h"
  #endif
  
-@@ -2203,16 +2207,25 @@ nsDownload::SetState(DownloadState aStat
+@@ -2192,16 +2196,25 @@ nsDownload::SetState(DownloadState aStat
        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
  
        // Master pref to control this function.
@@ -190,7 +194,7 @@
          PRInt64 goat = PR_Now() - mStartTime;
          showTaskbarAlert = goat > alertIntervalUSec;
  
-@@ -2236,18 +2249,19 @@ nsDownload::SetState(DownloadState aStat
+@@ -2225,19 +2238,20 @@ nsDownload::SetState(DownloadState aStat
                // If downloads are automatically removed per the user's
                // retention policy, there's no reason to make the text clickable
                // because if it is, they'll click open the download manager and
@@ -202,15 +206,16 @@
 -            }
 +          }
          }
-+        } // end non-KDE block
        }
++      }
  
- #if (defined(XP_WIN) && !defined(WINCE)) || defined(XP_MACOSX) || defined(ANDROID)
+ #if defined(XP_WIN) || defined(XP_MACOSX) || defined(ANDROID)
        nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
        nsCOMPtr<nsIFile> file;
        nsAutoString path;
  
        if (fileURL &&
+           NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
 --- a/toolkit/content/jar.mn
 +++ b/toolkit/content/jar.mn
@@ -2173,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
-@@ -94,17 +94,18 @@ EXPORTS = nsWindowsDllInterceptor.h
+@@ -97,17 +97,18 @@ EXPORTS = nsWindowsDllInterceptor.h
  else
  ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
  CMMSRCS = nsNativeAppSupportCocoa.mm
@@ -3187,7 +3192,7 @@
 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
-@@ -157,11 +157,14 @@ endif
+@@ -158,11 +158,14 @@ endif
  
  DEFINES		+= -DCAIRO_GFX
  
@@ -3556,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
-@@ -55,16 +55,17 @@
+@@ -59,16 +59,17 @@
  #include "nsTextFormatter.h"
  #include "nsVersionComparator.h"
  #include "nsXPCOMCIDInternal.h"
@@ -3574,7 +3579,7 @@
  
    // Some directives should only be delivered for NS_COMPONENT_LOCATION
    // manifests.
-@@ -422,16 +423,17 @@ ParseManifestCommon(NSLocationType aType
+@@ -426,16 +427,17 @@ ParseManifestCommon(NSLocationType aType
  
    NS_NAMED_LITERAL_STRING(kPlatform, "platform");
    NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
@@ -3592,7 +3597,7 @@
    nsAutoString appVersion;
    nsAutoString osTarget;
    nsAutoString abi;
-@@ -461,35 +463,39 @@ ParseManifestCommon(NSLocationType aType
+@@ -465,39 +467,44 @@ ParseManifestCommon(NSLocationType aType
          CopyUTF8toUTF16(s, abi);
          abi.Insert(PRUnichar('_'), 0);
          abi.Insert(osTarget, 0);
@@ -3624,6 +3629,11 @@
                                         gtk_major_version,
                                         gtk_minor_version);
 +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
+ #elif defined(ANDROID)
+   if (mozilla::AndroidBridge::Bridge()) {
+     mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", osVersion);
+   }
++  desktop = NS_LITERAL_STRING("android");
  #endif
  
    // Because contracts must be registered after CIDs, we save and process them
@@ -3632,7 +3642,7 @@
  
    char *token;
    char *newline = buf;
-@@ -558,24 +564,26 @@ ParseManifestCommon(NSLocationType aType
+@@ -566,24 +573,26 @@ ParseManifestCommon(NSLocationType aType
      bool ok = true;
      TriState stAppVersion = eUnspecified;
      TriState stApp = eUnspecified;
@@ -3659,7 +3669,7 @@
            (CheckFlag(kPlatform, wtoken, platform) ||
             CheckFlag(kContentAccessible, wtoken, contentAccessible)))
          continue;
-@@ -594,16 +602,17 @@ ParseManifestCommon(NSLocationType aType
+@@ -602,16 +611,17 @@ ParseManifestCommon(NSLocationType aType
        ok = false;
      }
  
@@ -3720,7 +3730,7 @@
  #include "prmem.h"
  #include "plbase64.h"
  
-@@ -1730,44 +1731,50 @@ nsLocalFile::SetPersistentDescriptor(con
+@@ -1769,44 +1770,50 @@ nsLocalFile::SetPersistentDescriptor(con
      return InitWithNativePath(aPersistentDescriptor);
  #endif
  }
@@ -3785,7 +3795,7 @@
        return rv;
      }
      return NS_ERROR_FAILURE;
-@@ -1793,16 +1800,23 @@ nsLocalFile::Launch()
+@@ -1832,16 +1839,23 @@ nsLocalFile::Launch()
  
      if (nsnull == connection)
        return NS_ERROR_FAILURE;