mozilla-kde.patch
changeset 289 3c0dff7ca9c4
parent 284 ccddc8555cdb
child 294 5330447b83a3
equal deleted inserted replaced
288:d51f3999a1c2 289:3c0dff7ca9c4
     1 diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in
     1 diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in
     2 --- a/modules/libpref/src/Makefile.in
     2 --- a/modules/libpref/src/Makefile.in
     3 +++ b/modules/libpref/src/Makefile.in
     3 +++ b/modules/libpref/src/Makefile.in
     4 @@ -90,14 +90,16 @@ GREPREF_FILES = $(topsrcdir)/netwerk/bas
     4 @@ -87,14 +87,16 @@ GREPREF_FILES = $(topsrcdir)/netwerk/bas
     5  # Optimizer bug with GCC 3.2.2 on OS/2
     5  # Optimizer bug with GCC 3.2.2 on OS/2
     6  ifeq ($(OS_ARCH), OS2)
     6  ifeq ($(OS_ARCH), OS2)
     7  nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp
     7  nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp
     8  	$(REPORT_BUILD)
     8  	$(REPORT_BUILD)
     9  	@$(MAKE_DEPS_AUTO_CXX)
     9  	@$(MAKE_DEPS_AUTO_CXX)
    16  greprefs.js: $(GREPREF_FILES)
    16  greprefs.js: $(GREPREF_FILES)
    17  	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ > $@
    17  	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ > $@
    18  
    18  
    19  libs:: greprefs.js
    19  libs:: greprefs.js
    20  	$(INSTALL) $^ $(DIST)/bin/
    20  	$(INSTALL) $^ $(DIST)/bin/
    21 diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp
    21 diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferences.cpp
    22 --- a/modules/libpref/src/nsPrefService.cpp
    22 --- a/modules/libpref/src/Preferences.cpp
    23 +++ b/modules/libpref/src/nsPrefService.cpp
    23 +++ b/modules/libpref/src/Preferences.cpp
    24 @@ -53,16 +53,17 @@
    24 @@ -53,16 +53,17 @@
    25  #include "nsIStringEnumerator.h"
    25  #include "nsIStringEnumerator.h"
    26  #include "nsIZipReader.h"
    26  #include "nsIZipReader.h"
    27  #include "nsPrefBranch.h"
    27  #include "nsPrefBranch.h"
    28  #include "nsXPIDLString.h"
    28  #include "nsXPIDLString.h"
    37  #include "pldhash.h"
    37  #include "pldhash.h"
    38  
    38  
    39  #include "prefapi.h"
    39  #include "prefapi.h"
    40  #include "prefread.h"
    40  #include "prefread.h"
    41  #include "prefapi_private_data.h"
    41  #include "prefapi_private_data.h"
    42 @@ -758,30 +759,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
    42 @@ -822,30 +823,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
    43  }
    43  }
    44  
    44  
    45  static nsresult pref_LoadPrefsInDirList(const char *listId)
    45  static nsresult pref_LoadPrefsInDirList(const char *listId)
    46  {
    46  {
    47    nsresult rv;
    47    nsresult rv;
    86      }
    86      }
    87    }
    87    }
    88    return NS_OK;
    88    return NS_OK;
    89  }
    89  }
    90  
    90  
    91  //----------------------------------------------------------------------------------------
    91  static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
    92 @@ -876,24 +895,36 @@ static nsresult pref_InitInitialObjects(
    92 @@ -938,28 +957,40 @@ static nsresult pref_InitInitialObjects(
    93    /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
    93      /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
    94    static const char* specialFiles[] = {
    94      static const char* specialFiles[] = {
    95  #if defined(XP_MAC) || defined(XP_MACOSX)
    95  #if defined(XP_MACOSX)
    96        "macprefs.js"
    96        "macprefs.js"
    97  #elif defined(XP_WIN)
    97  #elif defined(XP_WIN)
    98        "winpref.js"
    98        "winpref.js"
    99  #elif defined(XP_UNIX)
    99  #elif defined(XP_UNIX)
   100        "unix.js"
   100        "unix.js"
   101 +      , "" // placeholder for KDE  (empty is otherwise harmless)
   101 +      , "" // placeholder for KDE  (empty is otherwise harmless)
   102  #if defined(_AIX)
   102  #if defined(VMS)
       
   103        , "openvms.js"
       
   104  #elif defined(_AIX)
   103        , "aix.js"
   105        , "aix.js"
   104  #endif
   106  #endif
   105  #elif defined(XP_OS2)
   107  #elif defined(XP_OS2)
   106        "os2pref.js"
   108        "os2pref.js"
       
   109  #elif defined(XP_BEOS)
       
   110        "beos.js"
   107  #endif
   111  #endif
   108    };
   112      };
   109  
   113  
   110 +  if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
   114 +    if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
   111 +    for( int i = 0;
   115 +      for( int i = 0;
   112 +        i < NS_ARRAY_LENGTH(specialFiles);
   116 +          i < NS_ARRAY_LENGTH(specialFiles);
   113 +        ++i ) {
   117 +          ++i ) {
   114 +      if( *specialFiles[ i ] == '\0' ) {
   118 +        if( *specialFiles[ i ] == '\0' ) {
   115 +        specialFiles[ i ] = "kde.js";
   119 +          specialFiles[ i ] = "kde.js";
   116 +        break;
   120 +          break;
       
   121 +        }
   117 +      }
   122 +      }
   118 +    }
   123 +    }
   119 +  }
   124 +
   120 +
   125      rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
   121    rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
   126      if (NS_FAILED(rv))
   122    if (NS_FAILED(rv)) {
   127        NS_WARNING("Error parsing application default preferences.");
   123      NS_WARNING("Error parsing application default preferences.");
       
   124    }
   128    }
   125  
   129  
   126    rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST);
   130    // Load jar:$app/omni.jar!/defaults/preferences/*.js
   127    NS_ENSURE_SUCCESS(rv, rv);
   131    nsZipArchive *appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
   128  
   132    if (appJarReader) {
   129 diff --git a/toolkit/components/downloads/Makefile.in b/toolkit/components/downloads/Makefile.in
   133 diff --git a/toolkit/components/downloads/Makefile.in b/toolkit/components/downloads/Makefile.in
   130 --- a/toolkit/components/downloads/Makefile.in
   134 --- a/toolkit/components/downloads/Makefile.in
   131 +++ b/toolkit/components/downloads/Makefile.in
   135 +++ b/toolkit/components/downloads/Makefile.in
   132 @@ -79,8 +79,10 @@ endif
   136 @@ -79,8 +79,10 @@ endif
   133  
   137  
   143 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
   147 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
   144 --- a/toolkit/components/downloads/nsDownloadManager.cpp
   148 --- a/toolkit/components/downloads/nsDownloadManager.cpp
   145 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
   149 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
   146 @@ -71,16 +71,20 @@
   150 @@ -71,16 +71,20 @@
   147  
   151  
   148  #if defined(XP_WIN) && !defined(WINCE)
   152  #ifdef XP_WIN
   149  #include <shlobj.h>
   153  #include <shlobj.h>
   150  #ifdef DOWNLOAD_SCANNER
   154  #ifdef DOWNLOAD_SCANNER
   151  #include "nsDownloadScanner.h"
   155  #include "nsDownloadScanner.h"
   152  #endif
   156  #endif
   153  #endif
   157  #endif
   162  
   166  
   163  #ifdef ANDROID
   167  #ifdef ANDROID
   164  #include "AndroidBridge.h"
   168  #include "AndroidBridge.h"
   165  #endif
   169  #endif
   166  
   170  
   167 @@ -2203,16 +2207,25 @@ nsDownload::SetState(DownloadState aStat
   171 @@ -2192,16 +2196,25 @@ nsDownload::SetState(DownloadState aStat
   168        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   172        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   169  
   173  
   170        // Master pref to control this function.
   174        // Master pref to control this function.
   171        PRBool showTaskbarAlert = PR_TRUE;
   175        PRBool showTaskbarAlert = PR_TRUE;
   172        if (pref)
   176        if (pref)
   188  
   192  
   189          PRInt64 alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   193          PRInt64 alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   190          PRInt64 goat = PR_Now() - mStartTime;
   194          PRInt64 goat = PR_Now() - mStartTime;
   191          showTaskbarAlert = goat > alertIntervalUSec;
   195          showTaskbarAlert = goat > alertIntervalUSec;
   192  
   196  
   193 @@ -2236,18 +2249,19 @@ nsDownload::SetState(DownloadState aStat
   197 @@ -2225,19 +2238,20 @@ nsDownload::SetState(DownloadState aStat
   194                // If downloads are automatically removed per the user's
   198                // If downloads are automatically removed per the user's
   195                // retention policy, there's no reason to make the text clickable
   199                // retention policy, there's no reason to make the text clickable
   196                // because if it is, they'll click open the download manager and
   200                // because if it is, they'll click open the download manager and
   197                // the items they downloaded will have been removed.
   201                // the items they downloaded will have been removed.
   198                alerts->ShowAlertNotification(
   202                alerts->ShowAlertNotification(
   200                    message, !removeWhenDone, EmptyString(), mDownloadManager,
   204                    message, !removeWhenDone, EmptyString(), mDownloadManager,
   201                    EmptyString());
   205                    EmptyString());
   202 -            }
   206 -            }
   203 +          }
   207 +          }
   204          }
   208          }
   205 +        } // end non-KDE block
       
   206        }
   209        }
   207  
   210 +      }
   208  #if (defined(XP_WIN) && !defined(WINCE)) || defined(XP_MACOSX) || defined(ANDROID)
   211  
       
   212  #if defined(XP_WIN) || defined(XP_MACOSX) || defined(ANDROID)
   209        nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
   213        nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
   210        nsCOMPtr<nsIFile> file;
   214        nsCOMPtr<nsIFile> file;
   211        nsAutoString path;
   215        nsAutoString path;
   212  
   216  
   213        if (fileURL &&
   217        if (fileURL &&
       
   218            NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
   214 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   219 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   215 --- a/toolkit/content/jar.mn
   220 --- a/toolkit/content/jar.mn
   216 +++ b/toolkit/content/jar.mn
   221 +++ b/toolkit/content/jar.mn
   217 @@ -40,29 +40,33 @@ toolkit.jar:
   222 @@ -40,29 +40,33 @@ toolkit.jar:
   218  *+ content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
   223  *+ content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
  2171 +}
  2176 +}
  2172 +
  2177 +
  2173 diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in
  2178 diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in
  2174 --- a/toolkit/xre/Makefile.in
  2179 --- a/toolkit/xre/Makefile.in
  2175 +++ b/toolkit/xre/Makefile.in
  2180 +++ b/toolkit/xre/Makefile.in
  2176 @@ -94,17 +94,18 @@ EXPORTS = nsWindowsDllInterceptor.h
  2181 @@ -97,17 +97,18 @@ EXPORTS = nsWindowsDllInterceptor.h
  2177  else
  2182  else
  2178  ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
  2183  ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
  2179  CMMSRCS = nsNativeAppSupportCocoa.mm
  2184  CMMSRCS = nsNativeAppSupportCocoa.mm
  2180  else
  2185  else
  2181  ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
  2186  ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
  3185  
  3190  
  3186    // Now look up our extensions
  3191    // Now look up our extensions
  3187 diff --git a/widget/src/gtk2/Makefile.in b/widget/src/gtk2/Makefile.in
  3192 diff --git a/widget/src/gtk2/Makefile.in b/widget/src/gtk2/Makefile.in
  3188 --- a/widget/src/gtk2/Makefile.in
  3193 --- a/widget/src/gtk2/Makefile.in
  3189 +++ b/widget/src/gtk2/Makefile.in
  3194 +++ b/widget/src/gtk2/Makefile.in
  3190 @@ -157,11 +157,14 @@ endif
  3195 @@ -158,11 +158,14 @@ endif
  3191  
  3196  
  3192  DEFINES		+= -DCAIRO_GFX
  3197  DEFINES		+= -DCAIRO_GFX
  3193  
  3198  
  3194  INCLUDES	+= \
  3199  INCLUDES	+= \
  3195  		-I$(srcdir)/../xpwidgets \
  3200  		-I$(srcdir)/../xpwidgets \
  3554  CXXFLAGS += $(MOZ_GTK2_CFLAGS)
  3559  CXXFLAGS += $(MOZ_GTK2_CFLAGS)
  3555  endif
  3560  endif
  3556 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  3561 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  3557 --- a/xpcom/components/ManifestParser.cpp
  3562 --- a/xpcom/components/ManifestParser.cpp
  3558 +++ b/xpcom/components/ManifestParser.cpp
  3563 +++ b/xpcom/components/ManifestParser.cpp
  3559 @@ -55,16 +55,17 @@
  3564 @@ -59,16 +59,17 @@
  3560  #include "nsTextFormatter.h"
  3565  #include "nsTextFormatter.h"
  3561  #include "nsVersionComparator.h"
  3566  #include "nsVersionComparator.h"
  3562  #include "nsXPCOMCIDInternal.h"
  3567  #include "nsXPCOMCIDInternal.h"
  3563  
  3568  
  3564  #include "nsIConsoleService.h"
  3569  #include "nsIConsoleService.h"
  3572    const char* directive;
  3577    const char* directive;
  3573    int argc;
  3578    int argc;
  3574  
  3579  
  3575    // Some directives should only be delivered for NS_COMPONENT_LOCATION
  3580    // Some directives should only be delivered for NS_COMPONENT_LOCATION
  3576    // manifests.
  3581    // manifests.
  3577 @@ -422,16 +423,17 @@ ParseManifestCommon(NSLocationType aType
  3582 @@ -426,16 +427,17 @@ ParseManifestCommon(NSLocationType aType
  3578  
  3583  
  3579    NS_NAMED_LITERAL_STRING(kPlatform, "platform");
  3584    NS_NAMED_LITERAL_STRING(kPlatform, "platform");
  3580    NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
  3585    NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
  3581    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3586    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3582    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3587    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3590  
  3595  
  3591    nsAutoString appID;
  3596    nsAutoString appID;
  3592    nsAutoString appVersion;
  3597    nsAutoString appVersion;
  3593    nsAutoString osTarget;
  3598    nsAutoString osTarget;
  3594    nsAutoString abi;
  3599    nsAutoString abi;
  3595 @@ -461,35 +463,39 @@ ParseManifestCommon(NSLocationType aType
  3600 @@ -465,39 +467,44 @@ ParseManifestCommon(NSLocationType aType
  3596          CopyUTF8toUTF16(s, abi);
  3601          CopyUTF8toUTF16(s, abi);
  3597          abi.Insert(PRUnichar('_'), 0);
  3602          abi.Insert(PRUnichar('_'), 0);
  3598          abi.Insert(osTarget, 0);
  3603          abi.Insert(osTarget, 0);
  3599        }
  3604        }
  3600      }
  3605      }
  3622  #elif defined(MOZ_WIDGET_GTK2)
  3627  #elif defined(MOZ_WIDGET_GTK2)
  3623    nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
  3628    nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
  3624                                         gtk_major_version,
  3629                                         gtk_major_version,
  3625                                         gtk_minor_version);
  3630                                         gtk_minor_version);
  3626 +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
  3631 +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
       
  3632  #elif defined(ANDROID)
       
  3633    if (mozilla::AndroidBridge::Bridge()) {
       
  3634      mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", osVersion);
       
  3635    }
       
  3636 +  desktop = NS_LITERAL_STRING("android");
  3627  #endif
  3637  #endif
  3628  
  3638  
  3629    // Because contracts must be registered after CIDs, we save and process them
  3639    // Because contracts must be registered after CIDs, we save and process them
  3630    // at the end.
  3640    // at the end.
  3631    nsTArray<CachedDirective> contracts;
  3641    nsTArray<CachedDirective> contracts;
  3632  
  3642  
  3633    char *token;
  3643    char *token;
  3634    char *newline = buf;
  3644    char *newline = buf;
  3635 @@ -558,24 +564,26 @@ ParseManifestCommon(NSLocationType aType
  3645 @@ -566,24 +573,26 @@ ParseManifestCommon(NSLocationType aType
  3636      bool ok = true;
  3646      bool ok = true;
  3637      TriState stAppVersion = eUnspecified;
  3647      TriState stAppVersion = eUnspecified;
  3638      TriState stApp = eUnspecified;
  3648      TriState stApp = eUnspecified;
  3639      TriState stOsVersion = eUnspecified;
  3649      TriState stOsVersion = eUnspecified;
  3640      TriState stOs = eUnspecified;
  3650      TriState stOs = eUnspecified;
  3657  
  3667  
  3658        if (directive->contentflags &&
  3668        if (directive->contentflags &&
  3659            (CheckFlag(kPlatform, wtoken, platform) ||
  3669            (CheckFlag(kPlatform, wtoken, platform) ||
  3660             CheckFlag(kContentAccessible, wtoken, contentAccessible)))
  3670             CheckFlag(kContentAccessible, wtoken, contentAccessible)))
  3661          continue;
  3671          continue;
  3662 @@ -594,16 +602,17 @@ ParseManifestCommon(NSLocationType aType
  3672 @@ -602,16 +611,17 @@ ParseManifestCommon(NSLocationType aType
  3663        ok = false;
  3673        ok = false;
  3664      }
  3674      }
  3665  
  3675  
  3666      if (!ok ||
  3676      if (!ok ||
  3667          stApp == eBad ||
  3677          stApp == eBad ||
  3718  #include <Carbon/Carbon.h>
  3728  #include <Carbon/Carbon.h>
  3719  #include "CocoaFileUtils.h"
  3729  #include "CocoaFileUtils.h"
  3720  #include "prmem.h"
  3730  #include "prmem.h"
  3721  #include "plbase64.h"
  3731  #include "plbase64.h"
  3722  
  3732  
  3723 @@ -1730,44 +1731,50 @@ nsLocalFile::SetPersistentDescriptor(con
  3733 @@ -1769,44 +1770,50 @@ nsLocalFile::SetPersistentDescriptor(con
  3724      return InitWithNativePath(aPersistentDescriptor);
  3734      return InitWithNativePath(aPersistentDescriptor);
  3725  #endif
  3735  #endif
  3726  }
  3736  }
  3727  
  3737  
  3728  NS_IMETHODIMP
  3738  NS_IMETHODIMP
  3783        nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3793        nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3784        ::CFRelease(url);
  3794        ::CFRelease(url);
  3785        return rv;
  3795        return rv;
  3786      }
  3796      }
  3787      return NS_ERROR_FAILURE;
  3797      return NS_ERROR_FAILURE;
  3788 @@ -1793,16 +1800,23 @@ nsLocalFile::Launch()
  3798 @@ -1832,16 +1839,23 @@ nsLocalFile::Launch()
  3789  
  3799  
  3790      if (nsnull == connection)
  3800      if (nsnull == connection)
  3791        return NS_ERROR_FAILURE;
  3801        return NS_ERROR_FAILURE;
  3792  
  3802  
  3793      if (hildon_mime_open_file(connection, mPath.get()) != kHILDON_SUCCESS)
  3803      if (hildon_mime_open_file(connection, mPath.get()) != kHILDON_SUCCESS)