From cd332344180ffe021efd88a6fb84dc60944c51ff Mon Sep 17 00:00:00 2001 From: Rosa Date: Sun, 5 Feb 2012 04:10:47 +0400 Subject: [PATCH] Automatic import for version 10.0 --- .abf.yml | 2 +- firefox.spec | 18 +- mozilla-kde.patch | 871 ++++++++++++++++++++++++++++++++++------------ 3 files changed, 652 insertions(+), 239 deletions(-) diff --git a/.abf.yml b/.abf.yml index 0e90962..3e73ff2 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,3 +1,3 @@ --- sources: - firefox-9.0.1.source.tar.bz2: e0748d86753eead5c0929d74158c601bf33b5db0 + firefox-10.0.source.tar.bz2: cbf1fb0efe0a3a2b2dafaa324b136736e93de70c diff --git a/firefox.spec b/firefox.spec index fb8d763..da42cec 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1,5 +1,5 @@ -%define major 9 -%define realver %{major}.0.1 +%define major 10 +%define realver %{major}.0 # (tpg) MOZILLA_FIVE_HOME %define mozillalibdir %{_libdir}/%{name}-%{realver} @@ -8,11 +8,11 @@ %if %mandriva_branch == Cooker # Cooker -%define release 2 +%define release 1 %else # Old distros %define subrel 1 -%define release %mkrel 1 +%define release %mkrel 0 %endif # this seems fragile, so require the exact version or later (#58754) @@ -74,7 +74,7 @@ BuildRequires: java-rpmbuild BuildRequires: wget BuildRequires: libnotify-devel BuildRequires: libevent-devel >= 1.4.7 -BuildRequires: libvpx-devel >= 0.9.5 +BuildRequires: libvpx-devel >= 0.9.7 %if %mdkversion >= 201100 BuildRequires: cairo-devel >= 1.10 %endif @@ -107,8 +107,8 @@ Files and macros mainly for building Firefox extensions. %patch6 -p1 -b .wintitle ## KDE INTEGRATION # copy current files and patch them later to keep them in sync -%patch4 -p1 -b .kde -%patch41 -F 1 -p1 -b .kdemoz +# %%patch4 -p1 -b .kde +# %%patch41 -F 1 -p1 -b .kdemoz # install kde.js install -m 644 %{SOURCE9} browser/app/profile/kde.js @@ -276,6 +276,10 @@ fi %{_sys_macros_dir}/%{name}.macros %changelog +* Thu Feb 02 2012 Oden Eriksson 10.0-0.1 +- 10.0 +- disable the kde patches for now + * Tue Dec 27 2011 Oden Eriksson 9.0.1-0.1 - 9.0.1 - fix #64991 (Firefox and Thunderbird consider l10n plugins as third party) diff --git a/mozilla-kde.patch b/mozilla-kde.patch index 51475f0..436770a 100644 --- a/mozilla-kde.patch +++ b/mozilla-kde.patch @@ -1,7 +1,12 @@ -diff -Naurp mozilla-release/modules/libpref/src/Makefile.in mozilla-release.oden/modules/libpref/src/Makefile.in ---- mozilla-release/modules/libpref/src/Makefile.in 2011-12-16 20:29:37.000000000 +0000 -+++ mozilla-release.oden/modules/libpref/src/Makefile.in 2011-12-21 07:57:54.000000000 +0000 -@@ -82,6 +82,8 @@ nsPrefService.$(OBJ_SUFFIX): nsPrefServi +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 +@@ -77,14 +77,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 + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:-O2=-O1) $(_VPATH_SRCS) endif @@ -10,10 +15,18 @@ diff -Naurp mozilla-release/modules/libpref/src/Makefile.in mozilla-release.oden greprefs.js: $(GREPREF_FILES) $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ > $@ -diff -Naurp mozilla-release/modules/libpref/src/Preferences.cpp mozilla-release.oden/modules/libpref/src/Preferences.cpp ---- mozilla-release/modules/libpref/src/Preferences.cpp 2011-12-16 20:29:37.000000000 +0000 -+++ mozilla-release.oden/modules/libpref/src/Preferences.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -58,6 +58,7 @@ + + libs:: greprefs.js + $(INSTALL) $^ $(DIST)/bin/ +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 +@@ -56,16 +56,17 @@ + #include "nsIStringEnumerator.h" + #include "nsIZipReader.h" + #include "nsPrefBranch.h" + #include "nsXPIDLString.h" + #include "nsCRT.h" #include "nsCOMArray.h" #include "nsXPCOMCID.h" #include "nsAutoPtr.h" @@ -21,7 +34,17 @@ diff -Naurp mozilla-release/modules/libpref/src/Preferences.cpp mozilla-release. #include "nsQuickSort.h" #include "prmem.h" -@@ -961,6 +962,24 @@ static nsresult pref_LoadPrefsInDirList( + #include "pldhash.h" + + #include "prefapi.h" + #include "prefread.h" + #include "prefapi_private_data.h" +@@ -935,30 +936,48 @@ pref_LoadPrefsInDir(nsIFile* aDir, char + } + + static nsresult pref_LoadPrefsInDirList(const char *listId) + { + nsresult rv; nsCOMPtr dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); if (NS_FAILED(rv)) return rv; @@ -46,7 +69,13 @@ diff -Naurp mozilla-release/modules/libpref/src/Preferences.cpp mozilla-release. nsCOMPtr dirList; dirSvc->Get(listId, NS_GET_IID(nsISimpleEnumerator), -@@ -974,7 +993,7 @@ static nsresult pref_LoadPrefsInDirList( + getter_AddRefs(dirList)); + if (dirList) { + bool hasMore; + while (NS_SUCCEEDED(dirList->HasMoreElements(&hasMore)) && hasMore) { + nsCOMPtr elem; + dirList->GetNext(getter_AddRefs(elem)); + if (elem) { nsCOMPtr dir = do_QueryInterface(elem); if (dir) { // Do we care if a file provided by this process fails to load? @@ -55,7 +84,17 @@ diff -Naurp mozilla-release/modules/libpref/src/Preferences.cpp mozilla-release. } } } -@@ -1077,6 +1096,7 @@ static nsresult pref_InitInitialObjects( + } + return NS_OK; + } + + static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name) +@@ -1051,28 +1070,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" @@ -63,12 +102,17 @@ diff -Naurp mozilla-release/modules/libpref/src/Preferences.cpp mozilla-release. #if defined(VMS) , "openvms.js" #elif defined(_AIX) -@@ -1089,6 +1109,17 @@ static nsresult pref_InitInitialObjects( + , "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; ++ for(int i = 0; + i < NS_ARRAY_LENGTH(specialFiles); + ++i ) { + if( *specialFiles[ i ] == '\0' ) { @@ -78,22 +122,37 @@ diff -Naurp mozilla-release/modules/libpref/src/Preferences.cpp mozilla-release. + } + } + - rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles)); + rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, ArrayLength(specialFiles)); if (NS_FAILED(rv)) NS_WARNING("Error parsing application default preferences."); -diff -Naurp mozilla-release/toolkit/components/downloads/Makefile.in mozilla-release.oden/toolkit/components/downloads/Makefile.in ---- mozilla-release/toolkit/components/downloads/Makefile.in 2011-12-16 20:29:42.000000000 +0000 -+++ mozilla-release.oden/toolkit/components/downloads/Makefile.in 2011-12-21 07:57:54.000000000 +0000 -@@ -80,3 +80,5 @@ DIRS += test + + // 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 +@@ -75,8 +75,10 @@ EXTRA_COMPONENTS = \ + $(NULL) + endif + + ifdef ENABLE_TESTS + DIRS += test endif include $(topsrcdir)/config/rules.mk + +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre -diff -Naurp mozilla-release/toolkit/components/downloads/nsDownloadManager.cpp mozilla-release.oden/toolkit/components/downloads/nsDownloadManager.cpp ---- mozilla-release/toolkit/components/downloads/nsDownloadManager.cpp 2011-12-16 20:29:42.000000000 +0000 -+++ mozilla-release.oden/toolkit/components/downloads/nsDownloadManager.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -76,6 +76,10 @@ +diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp +--- a/toolkit/components/downloads/nsDownloadManager.cpp ++++ b/toolkit/components/downloads/nsDownloadManager.cpp +@@ -74,16 +74,20 @@ + + #ifdef XP_WIN + #include + #ifdef DOWNLOAD_SCANNER + #include "nsDownloadScanner.h" #endif #endif @@ -104,23 +163,43 @@ diff -Naurp mozilla-release/toolkit/components/downloads/nsDownloadManager.cpp m #ifdef XP_MACOSX #include #endif -@@ -2206,6 +2210,15 @@ nsDownload::SetState(DownloadState aStat + + #ifdef ANDROID + #include "AndroidBridge.h" + #endif + +@@ -2214,16 +2218,25 @@ nsDownload::SetState(DownloadState aStat + nsCOMPtr pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); + + // Master pref to control this function. + bool showTaskbarAlert = true; + if (pref) pref->GetBoolPref(PREF_BDM_SHOWALERTONCOMPLETE, &showTaskbarAlert); if (showTaskbarAlert) { + if( nsKDEUtils::kdeSupport()) { -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "DOWNLOADFINISHED" )); -+ nsAutoString displayName; -+ GetDisplayName( displayName ); -+ command.AppendCString( nsCAutoString( ToNewUTF8String( displayName ))); -+ nsKDEUtils::command( command ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "DOWNLOADFINISHED" )); ++ nsAutoString displayName; ++ GetDisplayName( displayName ); ++ command.AppendElement( nsCAutoString( ToNewUTF8String( displayName ))); ++ nsKDEUtils::command( command ); + } else { + // begin non-KDE block PRInt32 alertInterval = 2000; if (pref) pref->GetIntPref(PREF_BDM_SHOWALERTINTERVAL, &alertInterval); -@@ -2239,9 +2252,10 @@ nsDownload::SetState(DownloadState aStat + + PRInt64 alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; + PRInt64 goat = PR_Now() - mStartTime; + showTaskbarAlert = goat > alertIntervalUSec; + +@@ -2247,19 +2260,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 + // the items they downloaded will have been removed. + alerts->ShowAlertNotification( NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, message, !removeWhenDone, EmptyString(), mDownloadManager, EmptyString()); @@ -132,10 +211,20 @@ diff -Naurp mozilla-release/toolkit/components/downloads/nsDownloadManager.cpp m #if defined(XP_WIN) || defined(XP_MACOSX) || defined(ANDROID) nsCOMPtr fileURL = do_QueryInterface(mTarget); -diff -Naurp mozilla-release/toolkit/content/jar.mn mozilla-release.oden/toolkit/content/jar.mn ---- mozilla-release/toolkit/content/jar.mn 2011-12-16 20:29:43.000000000 +0000 -+++ mozilla-release.oden/toolkit/content/jar.mn 2011-12-21 07:57:54.000000000 +0000 -@@ -45,6 +45,8 @@ toolkit.jar: + nsCOMPtr 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 +@@ -40,29 +40,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) + *+ content/global/bindings/button.xml (widgets/button.xml) + *+ content/global/bindings/checkbox.xml (widgets/checkbox.xml) *+ content/global/bindings/colorpicker.xml (widgets/colorpicker.xml) *+ content/global/bindings/datetimepicker.xml (widgets/datetimepicker.xml) *+ content/global/bindings/dialog.xml (widgets/dialog.xml) @@ -144,7 +233,13 @@ diff -Naurp mozilla-release/toolkit/content/jar.mn mozilla-release.oden/toolkit/ *+ content/global/bindings/editor.xml (widgets/editor.xml) * content/global/bindings/expander.xml (widgets/expander.xml) * content/global/bindings/filefield.xml (widgets/filefield.xml) -@@ -58,6 +60,8 @@ toolkit.jar: + *+ content/global/bindings/findbar.xml (widgets/findbar.xml) + *+ content/global/bindings/general.xml (widgets/general.xml) + *+ content/global/bindings/groupbox.xml (widgets/groupbox.xml) + *+ content/global/bindings/listbox.xml (widgets/listbox.xml) + *+ content/global/bindings/menu.xml (widgets/menu.xml) + *+ content/global/bindings/menulist.xml (widgets/menulist.xml) + *+ content/global/bindings/notification.xml (widgets/notification.xml) *+ content/global/bindings/numberbox.xml (widgets/numberbox.xml) *+ content/global/bindings/popup.xml (widgets/popup.xml) *+ content/global/bindings/preferences.xml (widgets/preferences.xml) @@ -153,9 +248,15 @@ diff -Naurp mozilla-release/toolkit/content/jar.mn mozilla-release.oden/toolkit/ *+ content/global/bindings/progressmeter.xml (widgets/progressmeter.xml) *+ content/global/bindings/radio.xml (widgets/radio.xml) *+ content/global/bindings/resizer.xml (widgets/resizer.xml) -diff -Naurp mozilla-release/toolkit/content/widgets/dialog-kde.xml mozilla-release.oden/toolkit/content/widgets/dialog-kde.xml ---- mozilla-release/toolkit/content/widgets/dialog-kde.xml 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/toolkit/content/widgets/dialog-kde.xml 2011-12-21 07:57:54.000000000 +0000 + *+ content/global/bindings/richlistbox.xml (widgets/richlistbox.xml) + *+ content/global/bindings/scale.xml (widgets/scale.xml) + *+ content/global/bindings/scrollbar.xml (widgets/scrollbar.xml) + *+ content/global/bindings/scrollbox.xml (widgets/scrollbox.xml) + *+ content/global/bindings/splitter.xml (widgets/splitter.xml) +diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml +new file mode 100644 +--- /dev/null ++++ b/toolkit/content/widgets/dialog-kde.xml @@ -0,0 +1,447 @@ + + @@ -604,10 +705,11 @@ diff -Naurp mozilla-release/toolkit/content/widgets/dialog-kde.xml mozilla-relea + + + -diff -Naurp mozilla-release/toolkit/content/widgets/preferences-kde.xml mozilla-release.oden/toolkit/content/widgets/preferences-kde.xml ---- mozilla-release/toolkit/content/widgets/preferences-kde.xml 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/toolkit/content/widgets/preferences-kde.xml 2011-12-21 07:57:54.000000000 +0000 -@@ -0,0 +1,1371 @@ +diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml +new file mode 100644 +--- /dev/null ++++ b/toolkit/content/widgets/preferences-kde.xml +@@ -0,0 +1,1373 @@ + + + + // This "command" event handler tracks changes made to preferences by + // the user in this window. ++ if (event.sourceEvent) ++ event = event.sourceEvent; + this.userChangedValue(event.target); + + @@ -1979,10 +2083,15 @@ diff -Naurp mozilla-release/toolkit/content/widgets/preferences-kde.xml mozilla- +# PrefWindow II (???) +# PrefWindow I (June 4, 1999) +# -diff -Naurp mozilla-release/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp mozilla-release.oden/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp ---- mozilla-release/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 2011-12-16 20:29:44.000000000 +0000 -+++ mozilla-release.oden/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -49,6 +49,8 @@ +diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp ++++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +@@ -44,32 +44,35 @@ + #include "nsIURI.h" + #include "nsReadableUtils.h" + #include "nsArrayUtils.h" + #include "prnetdb.h" + #include "prenv.h" #include "nsPrintfCString.h" #include "nsNetUtil.h" #include "nsISupportsPrimitives.h" @@ -1991,15 +2100,34 @@ diff -Naurp mozilla-release/toolkit/system/unixproxy/nsUnixSystemProxySettings.c class nsUnixSystemProxySettings : public nsISystemProxySettings { public: -@@ -65,6 +67,7 @@ private: - PRBool IsProxyMode(const char* aMode); + NS_DECL_ISUPPORTS + NS_DECL_NSISYSTEMPROXYSETTINGS + + nsUnixSystemProxySettings() {} + nsresult Init(); + + private: + ~nsUnixSystemProxySettings() {} + + nsCOMPtr mGConf; + bool IsProxyMode(const char* aMode); nsresult SetProxyResultFromGConf(const char* aKeyBase, const char* aType, nsACString& aResult); nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult); + nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult); }; NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings) -@@ -406,6 +409,9 @@ nsUnixSystemProxySettings::GetProxyForUR + + nsresult + nsUnixSystemProxySettings::Init() + { + mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); +@@ -408,16 +411,19 @@ nsUnixSystemProxySettings::GetProxyForUR + nsCAutoString host; + rv = aURI->GetHost(host); + NS_ENSURE_SUCCESS(rv, rv); + + PRInt32 port; rv = aURI->GetPort(&port); NS_ENSURE_SUCCESS(rv, rv); @@ -2009,7 +2137,17 @@ diff -Naurp mozilla-release/toolkit/system/unixproxy/nsUnixSystemProxySettings.c if (!mGConf) return GetProxyFromEnvironment(scheme, host, port, aResult); -@@ -436,3 +442,29 @@ static const mozilla::Module kUnixProxyM + return GetProxyFromGConf(scheme, host, port, aResult); + } + + #define NS_UNIXSYSTEMPROXYSERVICE_CID /* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */\ + { 0x0fa3158c, 0xd5a7, 0x43de, \ +@@ -438,8 +444,34 @@ static const mozilla::Module::ContractID + + static const mozilla::Module kUnixProxyModule = { + mozilla::Module::kVersion, + kUnixProxyCIDs, + kUnixProxyContracts }; NSMODULE_DEFN(nsUnixProxyModule) = &kUnixProxyModule; @@ -2029,20 +2167,25 @@ diff -Naurp mozilla-release/toolkit/system/unixproxy/nsUnixSystemProxySettings.c + url += ":"; + url += nsPrintfCString("%d", aPort); + } -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "GETPROXY" )); -+ command.AppendCString( url ); -+ nsCStringArray result; ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "GETPROXY" )); ++ command.AppendElement( url ); ++ nsTArray result; + if( !nsKDEUtils::command( command, &result ) || result.Count() != 1 ) + return NS_ERROR_FAILURE; + aResult = *result[ 0 ]; + return NS_OK; +} + -diff -Naurp mozilla-release/toolkit/xre/Makefile.in mozilla-release.oden/toolkit/xre/Makefile.in ---- mozilla-release/toolkit/xre/Makefile.in 2011-12-16 20:29:44.000000000 +0000 -+++ mozilla-release.oden/toolkit/xre/Makefile.in 2011-12-21 07:59:01.000000000 +0000 -@@ -99,7 +99,8 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),os2) +diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in +--- a/toolkit/xre/Makefile.in ++++ b/toolkit/xre/Makefile.in +@@ -95,17 +95,18 @@ else + ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) + CMMSRCS = nsNativeAppSupportCocoa.mm + EXPORTS = MacQuirks.h + else + ifeq ($(MOZ_WIDGET_TOOLKIT),os2) CPPSRCS += nsNativeAppSupportOS2.cpp else ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) @@ -2052,10 +2195,16 @@ diff -Naurp mozilla-release/toolkit/xre/Makefile.in mozilla-release.oden/toolkit else ifeq ($(MOZ_WIDGET_TOOLKIT),qt) MOCSRCS += moc_nsNativeAppSupportQt.cpp -diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.cpp mozilla-release.oden/toolkit/xre/nsKDEUtils.cpp ---- mozilla-release/toolkit/xre/nsKDEUtils.cpp 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/toolkit/xre/nsKDEUtils.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -0,0 +1,328 @@ + CPPSRCS += $(MOCSRCS) + CPPSRCS += nsNativeAppSupportQt.cpp + CPPSRCS += nsQAppInstance.cpp + EXPORTS += nsQAppInstance.h + else +diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp +new file mode 100644 +--- /dev/null ++++ b/toolkit/xre/nsKDEUtils.cpp +@@ -0,0 +1,330 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -2150,10 +2299,10 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.cpp mozilla-release.oden/tool + +static bool getKdeSupport() + { -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "CHECK" )); -+ command.AppendCString( NS_LITERAL_CSTRING( MAKE_STR( KMOZILLAHELPER_VERSION ))); -+ bool kde = nsKDEUtils::command( command ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "CHECK" )); ++ command.AppendElement( NS_LITERAL_CSTRING( MAKE_STR( KMOZILLAHELPER_VERSION ))); ++ bool kde = nsKDEUtils::command( command.get() ); +#ifdef DEBUG_KDE + fprintf( stderr, "KDE RUNNING %d\n", kde ); +#endif @@ -2195,7 +2344,7 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.cpp mozilla-release.oden/tool +struct nsKDECommandData + { + FILE* file; -+ nsCStringArray* output; ++ nsTArray* output; + GMainLoop* loop; + bool success; + }; @@ -2219,7 +2368,7 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.cpp mozilla-release.oden/tool + line.ReplaceSubstring( "\\n", "\n" ); + line.ReplaceSubstring( "\\" "\\", "\\" ); // \\ -> \ , i.e. unescape + if( p->output && !( command_done || command_failed )) -+ p->output->AppendCString( nsCString( buf )); // TODO utf8? ++ p->output->AppendElement( nsCString( buf )); // TODO utf8? + } + bool quit = false; + if( feof( p->file ) || command_failed ) @@ -2241,22 +2390,24 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.cpp mozilla-release.oden/tool + return TRUE; + } + -+bool nsKDEUtils::command( const nsCStringArray& command, nsCStringArray* output ) ++bool nsKDEUtils::command( const nsTArray& command, nsTArray* output ) + { + return self()->internalCommand( command, NULL, false, output ); + } + -+bool nsKDEUtils::commandBlockUi( const nsCStringArray& command, const GtkWindow* parent, nsCStringArray* output ) ++bool nsKDEUtils::commandBlockUi( const nsTArray& command, const GtkWindow* parent, nsTArray* output ) + { + return self()->internalCommand( command, parent, true, output ); + } + -+bool nsKDEUtils::internalCommand( const nsCStringArray& command, const GtkWindow* parent, bool blockUi, -+ nsCStringArray* output ) ++bool nsKDEUtils::internalCommand( const nsTArray& command, const GtkWindow* parent, bool blockUi, ++ nsTArray* output ) + { ++ nsCString internal_command; ++ internal_command.AssignLiteral(command); + if( !startHelper()) + return false; -+ feedCommand( command ); ++ feedCommand(internal_command); + // do not store the data in 'this' but in extra structure, just in case there + // is reentrancy (can there be? the event loop is re-entered) + nsKDECommandData data; @@ -2366,13 +2517,13 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.cpp mozilla-release.oden/tool + helperRunning = false; + } + -+void nsKDEUtils::feedCommand( const nsCStringArray& command ) ++void nsKDEUtils::feedCommand( const nsTArray& command ) + { + for( int i = 0; -+ i < command.Count(); ++ i < command.Length(); + ++i ) + { -+ nsCString line = *command[ i ]; ++ nsCString line = command[ i ]; + line.ReplaceSubstring( "\\", "\\" "\\" ); // \ -> \\ , i.e. escape + line.ReplaceSubstring( "\n", "\\n" ); +#ifdef DEBUG_KDE @@ -2384,10 +2535,11 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.cpp mozilla-release.oden/tool + fputs( "\\E\n", commandFile ); // done as \E, so it cannot happen in normal data + fflush( commandFile ); + } -diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.h mozilla-release.oden/toolkit/xre/nsKDEUtils.h ---- mozilla-release/toolkit/xre/nsKDEUtils.h 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/toolkit/xre/nsKDEUtils.h 2011-12-21 07:57:54.000000000 +0000 -@@ -0,0 +1,77 @@ +diff --git a/toolkit/xre/nsKDEUtils.h b/toolkit/xre/nsKDEUtils.h +new file mode 100644 +--- /dev/null ++++ b/toolkit/xre/nsKDEUtils.h +@@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * ***** BEGIN LICENSE BLOCK ***** @@ -2430,7 +2582,7 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.h mozilla-release.oden/toolki +#define nsKDEUtils_h__ + +#include "nsStringGlue.h" -+#include "nsVoidArray.h" ++#include "nsTArray.h" +#include + +typedef struct _GtkWindow GtkWindow; @@ -2446,29 +2598,35 @@ diff -Naurp mozilla-release/toolkit/xre/nsKDEUtils.h mozilla-release.oden/toolki + for Firefox. This should be used everywhere where the external helper is needed. */ + static bool kdeSupport(); + /* Executes the given helper command, returns true if helper returned success. */ -+ static bool command( const nsCStringArray& command, nsCStringArray* output = NULL ); ++ static bool command( const nsTArray& command, nsTArray* output = NULL ); + /* Like command(), but additionally blocks the parent widget like if there was + a modal dialog shown and enters the event loop (i.e. there are still paint updates, + this is for commands that take long). */ -+ static bool commandBlockUi( const nsCStringArray& command, const GtkWindow* parent, nsCStringArray* output = NULL ); ++ static bool commandBlockUi( const nsTArray& command, const GtkWindow* parent, nsTArray* output = NULL ); ++ + private: + nsKDEUtils(); + ~nsKDEUtils(); + static nsKDEUtils* self(); + bool startHelper(); + void closeHelper(); -+ void feedCommand( const nsCStringArray& command ); -+ bool internalCommand( const nsCStringArray& command, const GtkWindow* parent, bool isParent, -+ nsCStringArray* output ); ++ void feedCommand( const nsTArray& command ); ++ bool internalCommand( const nsTArray& command, const GtkWindow* parent, bool isParent, ++ nsTArray* output ); + FILE* commandFile; + FILE* replyFile; + }; + +#endif // nsKDEUtils -diff -Naurp mozilla-release/uriloader/exthandler/Makefile.in mozilla-release.oden/uriloader/exthandler/Makefile.in ---- mozilla-release/uriloader/exthandler/Makefile.in 2011-12-16 20:29:46.000000000 +0000 -+++ mozilla-release.oden/uriloader/exthandler/Makefile.in 2011-12-21 07:57:54.000000000 +0000 -@@ -93,8 +93,9 @@ LOCAL_INCLUDES += -I$(topsrcdir)/dom/bas +diff --git a/uriloader/exthandler/Makefile.in b/uriloader/exthandler/Makefile.in +--- a/uriloader/exthandler/Makefile.in ++++ b/uriloader/exthandler/Makefile.in +@@ -88,18 +88,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 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) @@ -2479,9 +2637,15 @@ diff -Naurp mozilla-release/uriloader/exthandler/Makefile.in mozilla-release.ode endif ifeq ($(MOZ_WIDGET_TOOLKIT),android) -diff -Naurp mozilla-release/uriloader/exthandler/unix/nsCommonRegistry.cpp mozilla-release.oden/uriloader/exthandler/unix/nsCommonRegistry.cpp ---- mozilla-release/uriloader/exthandler/unix/nsCommonRegistry.cpp 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/uriloader/exthandler/unix/nsCommonRegistry.cpp 2011-12-21 07:57:54.000000000 +0000 + OSHELPER += nsMIMEInfoAndroid.cpp + OSHELPER += nsAndroidHandlerApp.cpp + OSHELPER += nsExternalSharingAppService.cpp + EXPORTS += nsExternalSharingAppService.h + OSHELPER += nsExternalURLHandlerService.cpp +diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp +new file mode 100644 +--- /dev/null ++++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** @@ -2570,9 +2734,10 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsCommonRegistry.cpp mozil + return nsKDERegistry::GetFromType( aMIMEType ); + return nsGNOMERegistry::GetFromType( aMIMEType ); +} -diff -Naurp mozilla-release/uriloader/exthandler/unix/nsCommonRegistry.h mozilla-release.oden/uriloader/exthandler/unix/nsCommonRegistry.h ---- mozilla-release/uriloader/exthandler/unix/nsCommonRegistry.h 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/uriloader/exthandler/unix/nsCommonRegistry.h 2011-12-21 07:57:54.000000000 +0000 +diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h +new file mode 100644 +--- /dev/null ++++ b/uriloader/exthandler/unix/nsCommonRegistry.h @@ -0,0 +1,56 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -2630,9 +2795,10 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsCommonRegistry.h mozilla + + static already_AddRefed GetFromType(const nsACString& aMIMEType); +}; -diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.cpp mozilla-release.oden/uriloader/exthandler/unix/nsKDERegistry.cpp ---- mozilla-release/uriloader/exthandler/unix/nsKDERegistry.cpp 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/uriloader/exthandler/unix/nsKDERegistry.cpp 2011-12-21 07:57:54.000000000 +0000 +diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp +new file mode 100644 +--- /dev/null ++++ b/uriloader/exthandler/unix/nsKDERegistry.cpp @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** @@ -2684,20 +2850,20 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.cpp mozilla- +/* static */ PRBool +nsKDERegistry::HandlerExists(const char *aProtocolScheme) +{ -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "HANDLEREXISTS" )); -+ command.AppendCString( nsCAutoString( aProtocolScheme )); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "HANDLEREXISTS" )); ++ command.AppendElement( nsCAutoString( aProtocolScheme )); + return nsKDEUtils::command( command ); +} + +/* static */ nsresult +nsKDERegistry::LoadURL(nsIURI *aURL) +{ -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "OPEN" )); + nsCString url; + aURL->GetSpec( url ); -+ command.AppendCString( url ); ++ command.AppendElement( url ); + return nsKDEUtils::command( command ); +} + @@ -2705,12 +2871,12 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.cpp mozilla- +nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme, + nsAString& aDesc) +{ -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "GETAPPDESCFORSCHEME" )); -+ command.AppendCString( aScheme ); -+ nsCStringArray output; -+ if( nsKDEUtils::command( command, &output ) && output.Count() == 1 ) -+ CopyUTF8toUTF16( *output[ 0 ], aDesc ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "GETAPPDESCFORSCHEME" )); ++ command.AppendElement( aScheme ); ++ nsTArray output; ++ if( nsKDEUtils::command( command, &output ) && output.Length() == 1 ) ++ CopyUTF8toUTF16( output[ 0 ], aDesc ); +} + + @@ -2718,33 +2884,33 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.cpp mozilla- +nsKDERegistry::GetFromExtension(const nsACString& aFileExt) +{ + NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot"); -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "GETFROMEXTENSION" )); -+ command.AppendCString( aFileExt ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "GETFROMEXTENSION" )); ++ command.AppendElement( aFileExt ); + return GetFromHelper( command ); +} + +/* static */ already_AddRefed +nsKDERegistry::GetFromType(const nsACString& aMIMEType) +{ -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "GETFROMTYPE" )); -+ command.AppendCString( aMIMEType ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "GETFROMTYPE" )); ++ command.AppendElement( aMIMEType ); + return GetFromHelper( command ); +} + +/* static */ already_AddRefed -+nsKDERegistry::GetFromHelper(const nsCStringArray& command) ++nsKDERegistry::GetFromHelper(const nsTArray& command) +{ -+ nsCStringArray output; -+ if( nsKDEUtils::command( command, &output ) && output.Count() == 3 ) ++ nsTArray output; ++ if( nsKDEUtils::command( command, &output ) && output.Length() == 3 ) + { -+ nsCString mimetype = *output[ 0 ]; ++ nsCString mimetype = output[ 0 ]; + nsRefPtr mimeInfo = new nsMIMEInfoUnix( mimetype ); + NS_ENSURE_TRUE(mimeInfo, nsnull); -+ nsCString description = *output[ 1 ]; ++ nsCString description = output[ 1 ]; + mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); -+ nsCString handlerAppName = *output[ 2 ]; ++ nsCString handlerAppName = output[ 2 ]; + mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); + mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); + nsMIMEInfoBase* retval; @@ -2753,10 +2919,11 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.cpp mozilla- + } + return nsnull; +} -diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.h mozilla-release.oden/uriloader/exthandler/unix/nsKDERegistry.h ---- mozilla-release/uriloader/exthandler/unix/nsKDERegistry.h 1970-01-01 00:00:00.000000000 +0000 -+++ mozilla-release.oden/uriloader/exthandler/unix/nsKDERegistry.h 2011-12-21 07:57:54.000000000 +0000 -@@ -0,0 +1,61 @@ +diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h +new file mode 100644 +--- /dev/null ++++ b/uriloader/exthandler/unix/nsKDERegistry.h +@@ -0,0 +1,62 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * @@ -2796,10 +2963,11 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.h mozilla-re + +#include "nsIURI.h" +#include "nsCOMPtr.h" ++#include "nsTArray.h" + +class nsMIMEInfoBase; +class nsCAutoString; -+class nsCStringArray; ++class nsCString; + +class nsKDERegistry +{ @@ -2815,13 +2983,18 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsKDERegistry.h mozilla-re + + static already_AddRefed GetFromType(const nsACString& aMIMEType); + private: -+ static already_AddRefed GetFromHelper(const nsCStringArray& command); ++ static already_AddRefed GetFromHelper(const nsTArray& command); + +}; -diff -Naurp mozilla-release/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp mozilla-release.oden/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp ---- mozilla-release/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp 2011-12-16 20:29:46.000000000 +0000 -+++ mozilla-release.oden/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -55,7 +55,7 @@ +diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp ++++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +@@ -50,30 +50,33 @@ + #include + #if (MOZ_ENABLE_CONTENTACTION) + #include + #include "nsContentHandlerApp.h" + #endif #endif #include "nsMIMEInfoUnix.h" @@ -2830,7 +3003,8 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp mozilla #include "nsIGIOService.h" #include "nsNetCID.h" #include "nsIIOService.h" -@@ -64,11 +64,14 @@ + #include "nsIGnomeVFSService.h" + #include "nsAutoPtr.h" #ifdef MOZ_ENABLE_DBUS #include "nsDBusHandlerApp.h" #endif @@ -2846,10 +3020,20 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp mozilla #if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS) if (NS_FAILED(rv)){ -@@ -100,12 +103,12 @@ NS_IMETHODIMP - nsMIMEInfoUnix::GetHasDefaultHandler(PRBool *_retval) + HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nsnull); + if (action) { + nsCAutoString spec; + aURI->GetAsciiSpec(spec); + if (hildon_uri_open(spec.get(), action, nsnull)) +@@ -95,22 +98,22 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * + + return rv; + } + + NS_IMETHODIMP + nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) { - *_retval = PR_FALSE; + *_retval = false; - nsRefPtr mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType); + nsRefPtr mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType); if (!mimeInfo) { @@ -2861,18 +3045,28 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp mozilla } } if (mimeInfo) -@@ -158,6 +161,23 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns + *_retval = true; + + if (*_retval) + return NS_OK; + +@@ -153,16 +156,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns + ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get())); + if (action.isValid()) { + action.trigger(); + return NS_OK; + } return NS_ERROR_FAILURE; #endif + if( nsKDEUtils::kdeSupport()) { -+ PRBool supports; ++ bool supports; + if( NS_SUCCEEDED( GetHasDefaultHandler( &supports )) && supports ) { -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); -+ command.AppendCString( nativePath ); -+ command.AppendCString( NS_LITERAL_CSTRING( "MIMETYPE" )); -+ command.AppendCString( mSchemeOrType ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "OPEN" )); ++ command.AppendElement( nativePath ); ++ command.AppendElement( NS_LITERAL_CSTRING( "MIMETYPE" )); ++ command.AppendElement( mSchemeOrType ); + if( nsKDEUtils::command( command )) + return NS_OK; + } @@ -2885,7 +3079,17 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp mozilla nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); nsCAutoString uriSpec; if (giovfs) { -@@ -185,7 +205,7 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns + // nsGIOMimeApp->Launch wants a URI string instead of local file + nsresult rv; + nsCOMPtr ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + nsCOMPtr uri; +@@ -180,17 +200,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns + /* Fallback to GnomeVFS */ + nsCOMPtr app; + if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) + return app->Launch(nativePath); + } // If we haven't got an app we try to get a valid one by searching for the // extension mapped type @@ -2894,10 +3098,20 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp mozilla if (mimeInfo) { nsCAutoString type; mimeInfo->GetType(type); -diff -Naurp mozilla-release/uriloader/exthandler/unix/nsOSHelperAppService.cpp mozilla-release.oden/uriloader/exthandler/unix/nsOSHelperAppService.cpp ---- mozilla-release/uriloader/exthandler/unix/nsOSHelperAppService.cpp 2011-12-16 20:29:46.000000000 +0000 -+++ mozilla-release.oden/uriloader/exthandler/unix/nsOSHelperAppService.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -49,7 +49,7 @@ + if (giovfs) { + nsCOMPtr app; + if (NS_SUCCEEDED(giovfs->GetAppForMimeType(type, getter_AddRefs(app))) && app) + return app->Launch(uriSpec); + } else if (gnomevfs) { +diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp +--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp ++++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp +@@ -44,17 +44,17 @@ + #if defined(MOZ_ENABLE_CONTENTACTION) + #include + #include + #endif + #include "nsOSHelperAppService.h" #include "nsMIMEInfoUnix.h" #ifdef MOZ_WIDGET_GTK2 @@ -2906,7 +3120,17 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsOSHelperAppService.cpp m #endif #include "nsISupports.h" #include "nsString.h" -@@ -1196,7 +1196,7 @@ nsresult nsOSHelperAppService::OSProtoco + #include "nsReadableUtils.h" + #include "nsUnicharUtils.h" + #include "nsXPIDLString.h" + #include "nsIURL.h" + #include "nsIFileStreams.h" +@@ -1191,29 +1191,29 @@ nsresult nsOSHelperAppService::OSProtoco + ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':'); + + if (action.isValid()) + *aHandlerExists = true; + #endif #ifdef MOZ_WIDGET_GTK2 // Check the GConf registry for a protocol handler @@ -2915,7 +3139,11 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsOSHelperAppService.cpp m #if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS) *aHandlerExists = nsMIMEInfoUnix::HandlerExists(aProtocolScheme); #endif -@@ -1208,7 +1208,7 @@ nsresult nsOSHelperAppService::OSProtoco + #endif + + return NS_OK; + } + NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval) { #ifdef MOZ_WIDGET_GTK2 @@ -2924,7 +3152,17 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsOSHelperAppService.cpp m return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK; #else return NS_ERROR_NOT_AVAILABLE; -@@ -1304,7 +1304,7 @@ nsOSHelperAppService::GetFromExtension(c + #endif + } + + nsresult nsOSHelperAppService::GetFileTokenForPath(const PRUnichar * platformAppPath, nsIFile ** aFile) + { +@@ -1299,17 +1299,17 @@ nsOSHelperAppService::GetFromExtension(c + minorType, + mime_types_description, + true); + + if (NS_FAILED(rv) || majorType.IsEmpty()) { #ifdef MOZ_WIDGET_GTK2 LOG(("Looking in GNOME registry\n")); @@ -2933,7 +3171,17 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsOSHelperAppService.cpp m if (gnomeInfo) { LOG(("Got MIMEInfo from GNOME registry\n")); return gnomeInfo; -@@ -1430,7 +1430,7 @@ nsOSHelperAppService::GetFromType(const + } + #endif + + rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), + majorType, +@@ -1425,17 +1425,17 @@ nsOSHelperAppService::GetFromType(const + #ifdef MOZ_WIDGET_GTK2 + nsMIMEInfoBase *gnomeInfo = nsnull; + if (handler.IsEmpty()) { + // No useful data yet. Check the GNOME registry. Unfortunately, newer + // GNOME versions no longer have type-to-extension mappings, so we might // get back a MIMEInfo without any extensions set. In that case we'll have // to look in our mime.types files for the extensions. LOG(("Looking in GNOME registry\n")); @@ -2942,10 +3190,20 @@ diff -Naurp mozilla-release/uriloader/exthandler/unix/nsOSHelperAppService.cpp m if (gnomeInfo && gnomeInfo->HasExtensions()) { LOG(("Got MIMEInfo from GNOME registry, and it has extensions set\n")); return gnomeInfo; -diff -Naurp mozilla-release/widget/src/gtk2/Makefile.in mozilla-release.oden/widget/src/gtk2/Makefile.in ---- mozilla-release/widget/src/gtk2/Makefile.in 2011-12-16 20:29:47.000000000 +0000 -+++ mozilla-release.oden/widget/src/gtk2/Makefile.in 2011-12-21 07:57:54.000000000 +0000 -@@ -140,6 +140,9 @@ INCLUDES += \ + } + } + #endif + + // Now look up our extensions +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 +@@ -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) @@ -2955,18 +3213,33 @@ diff -Naurp mozilla-release/widget/src/gtk2/Makefile.in mozilla-release.oden/wid ifdef MOZ_X11 INCLUDES += -I$(srcdir)/../shared/x11 endif -diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.oden/widget/src/gtk2/nsFilePicker.cpp ---- mozilla-release/widget/src/gtk2/nsFilePicker.cpp 2011-12-16 20:29:47.000000000 +0000 -+++ mozilla-release.oden/widget/src/gtk2/nsFilePicker.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -36,6 +36,7 @@ +diff --git a/widget/src/gtk2/nsFilePicker.cpp b/widget/src/gtk2/nsFilePicker.cpp +--- a/widget/src/gtk2/nsFilePicker.cpp ++++ b/widget/src/gtk2/nsFilePicker.cpp +@@ -33,16 +33,17 @@ + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * * ***** END LICENSE BLOCK ***** */ + #include "mozilla/Util.h" + #include +#include #include "nsIFileURL.h" #include "nsIURI.h" -@@ -54,6 +55,7 @@ + #include "nsIWidget.h" + #include "nsILocalFile.h" + #include "nsIStringBundle.h" + + #include "nsArrayEnumerator.h" +@@ -51,16 +52,17 @@ + #include "nsNetUtil.h" + #include "nsReadableUtils.h" + #include "mozcontainer.h" + + #include "prmem.h" #include "prlink.h" #include "nsFilePicker.h" @@ -2974,7 +3247,17 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode #if (MOZ_PLATFORM_MAEMO == 5) #include -@@ -286,7 +288,9 @@ nsFilePicker::AppendFilter(const nsAStri + #endif + + using namespace mozilla; + + #define MAX_PREVIEW_SIZE 180 +@@ -285,17 +287,19 @@ nsFilePicker::AppendFilters(PRInt32 aFil + return nsBaseFilePicker::AppendFilters(aFilterMask); + } + + NS_IMETHODIMP + nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { if (aFilter.EqualsLiteral("..apps")) { // No platform specific thing we can do here, really.... @@ -2985,7 +3268,17 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode } nsCAutoString filter, name; -@@ -434,6 +438,9 @@ confirm_overwrite_file(GtkWidget *parent + CopyUTF16toUTF8(aFilter, filter); + CopyUTF16toUTF8(aTitle, name); + + mFilters.AppendElement(filter); + mFilterNames.AppendElement(name); +@@ -433,16 +437,19 @@ confirm_overwrite_file(GtkWidget *parent + gtk_widget_destroy(dialog); + + return result; + } + NS_IMETHODIMP nsFilePicker::Show(PRInt16 *aReturn) { @@ -2995,7 +3288,17 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode NS_ENSURE_ARG_POINTER(aReturn); nsXPIDLCString title; -@@ -584,3 +591,229 @@ nsFilePicker::Show(PRInt16 *aReturn) + title.Adopt(ToNewUTF8String(mTitle)); + + GtkWindow *parent_widget = get_gtk_window_for_nsiwidget(mParentWidget); + + GtkFileChooserAction action = GetGtkFileChooserAction(mMode); +@@ -583,8 +590,234 @@ nsFilePicker::Show(PRInt16 *aReturn) + *aReturn = nsIFilePicker::returnCancel; + break; + } + + gtk_widget_destroy(file_chooser); return NS_OK; } @@ -3104,47 +3407,47 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode + } + } + -+ nsCStringArray command; -+ command.AppendCString( nsCAutoString( arg )); -+ command.AppendCString( startdir ); ++ nsTArray command; ++ command.AppendElement( nsCAutoString( arg )); ++ command.AppendElement( startdir ); + if( mMode != nsIFilePicker::modeGetFolder ) + { -+ command.AppendCString( filters ); ++ command.AppendElement( filters ); + nsCAutoString selected; + selected.AppendInt( mSelectedType ); -+ command.AppendCString( selected ); ++ command.AppendElement( selected ); + } -+ command.AppendCString( title ); ++ command.AppendElement( title ); + if( mMode == nsIFilePicker::modeOpenMultiple ) -+ command.AppendCString( NS_LITERAL_CSTRING( "MULTIPLE" )); ++ command.AppendElement( NS_LITERAL_CSTRING( "MULTIPLE" )); + if( PRInt32 xid = windowToXid( mParentWidget )) + { -+ command.AppendCString( NS_LITERAL_CSTRING( "PARENT" )); ++ command.AppendElement( NS_LITERAL_CSTRING( "PARENT" )); + nsCAutoString parent; + parent.AppendInt( xid ); -+ command.AppendCString( parent ); ++ command.AppendElement( parent ); + } + -+ nsCStringArray output; ++ nsTArray output; + if( nsKDEUtils::commandBlockUi( command, get_gtk_window_for_nsiwidget( mParentWidget ), &output )) + { + *aReturn = nsIFilePicker::returnOK; + mFiles.Clear(); + if( mMode != nsIFilePicker::modeGetFolder ) + { -+ mSelectedType = atoi( output[ 0 ]->get()); -+ output.RemoveCStringAt( 0 ); ++ mSelectedType = atoi( output[ 0 ].get()); ++ output.RemoveElementAt( 0 ); + } + if (mMode == nsIFilePicker::modeOpenMultiple) + { + mFileURL.Truncate(); -+ PRUint32 count = output.Count(); ++ PRUint32 count = output.Length(); + for( PRUint32 i = 0; + i < count; + ++i ) + { + nsCOMPtr localfile; -+ nsresult rv = NS_NewNativeLocalFile( *output[ i ], ++ nsresult rv = NS_NewNativeLocalFile( output[ i ], + PR_FALSE, + getter_AddRefs(localfile)); + if (NS_SUCCEEDED(rv)) @@ -3153,14 +3456,14 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode + } + else + { -+ if( output.Count() == 0 ) ++ if( output.Length() == 0 ) + mFileURL = nsCString(); + else if( mAllowURLs ) -+ mFileURL = *output[ 0 ]; ++ mFileURL = output[ 0 ]; + else // GetFile() actually requires it to be url even for local files :-/ + { + mFileURL = nsCString( "file://" ); -+ mFileURL.Append( *output[ 0 ] ); ++ mFileURL.Append( output[ 0 ] ); + } + } + // Remember last used directory. @@ -3180,7 +3483,7 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode + GetFile(getter_AddRefs(file)); + if (file) + { -+ PRBool exists = PR_FALSE; ++ bool exists = false; + file->Exists(&exists); + if (exists) // TODO do overwrite check in the helper app + *aReturn = nsIFilePicker::returnReplace; @@ -3202,22 +3505,22 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode + nsXPIDLCString title; + title.Adopt(ToNewUTF8String(mTitle)); + -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "APPSDIALOG" )); -+ command.AppendCString( title ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING( "APPSDIALOG" )); ++ command.AppendElement( title ); + if( PRInt32 xid = windowToXid( mParentWidget )) + { -+ command.AppendCString( NS_LITERAL_CSTRING( "PARENT" )); ++ command.AppendElement( NS_LITERAL_CSTRING( "PARENT" )); + nsCAutoString parent; + parent.AppendInt( xid ); -+ command.AppendCString( parent ); ++ command.AppendElement( parent ); + } + -+ nsCStringArray output; ++ nsTArray output; + if( nsKDEUtils::commandBlockUi( command, get_gtk_window_for_nsiwidget( mParentWidget ), &output )) + { + *aReturn = nsIFilePicker::returnOK; -+ mFileURL = output.Count() > 0 ? *output[ 0 ] : nsCString(); ++ mFileURL = output.Length() > 0 ? output[ 0 ] : nsCString(); + } + else + { @@ -3225,10 +3528,15 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.cpp mozilla-release.ode + } + return NS_OK; + } -diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.h mozilla-release.oden/widget/src/gtk2/nsFilePicker.h ---- mozilla-release/widget/src/gtk2/nsFilePicker.h 2011-12-16 20:29:47.000000000 +0000 -+++ mozilla-release.oden/widget/src/gtk2/nsFilePicker.h 2011-12-21 07:57:54.000000000 +0000 -@@ -94,6 +94,12 @@ protected: +diff --git a/widget/src/gtk2/nsFilePicker.h b/widget/src/gtk2/nsFilePicker.h +--- a/widget/src/gtk2/nsFilePicker.h ++++ b/widget/src/gtk2/nsFilePicker.h +@@ -89,11 +89,17 @@ protected: + nsString mDefault; + nsString mDefaultExtension; + + nsTArray mFilters; + nsTArray mFilterNames; private: static nsILocalFile *mPrevDisplayDirectory; @@ -3241,36 +3549,66 @@ diff -Naurp mozilla-release/widget/src/gtk2/nsFilePicker.h mozilla-release.oden/ }; #endif -diff -Naurp mozilla-release/xpcom/components/Makefile.in mozilla-release.oden/xpcom/components/Makefile.in ---- mozilla-release/xpcom/components/Makefile.in 2011-12-16 20:29:47.000000000 +0000 -+++ mozilla-release.oden/xpcom/components/Makefile.in 2011-12-21 07:57:54.000000000 +0000 -@@ -99,5 +99,6 @@ include $(topsrcdir)/config/rules.mk +diff --git a/xpcom/components/Makefile.in b/xpcom/components/Makefile.in +--- a/xpcom/components/Makefile.in ++++ b/xpcom/components/Makefile.in +@@ -94,10 +94,11 @@ FORCE_STATIC_LIB = 1 + + # Force use of PIC + FORCE_USE_PIC = 1 + include $(topsrcdir)/config/rules.mk + DEFINES += -D_IMPL_NS_COM ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre CXXFLAGS += $(MOZ_GTK2_CFLAGS) endif -diff -Naurp mozilla-release/xpcom/components/ManifestParser.cpp mozilla-release.oden/xpcom/components/ManifestParser.cpp ---- mozilla-release/xpcom/components/ManifestParser.cpp 2011-12-16 20:29:47.000000000 +0000 -+++ mozilla-release.oden/xpcom/components/ManifestParser.cpp 2011-12-21 08:04:39.000000000 +0000 -@@ -65,6 +65,7 @@ +diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp +--- a/xpcom/components/ManifestParser.cpp ++++ b/xpcom/components/ManifestParser.cpp +@@ -62,16 +62,17 @@ + #include "nsTextFormatter.h" + #include "nsVersionComparator.h" + #include "nsXPCOMCIDInternal.h" + + #include "nsIConsoleService.h" #include "nsIScriptError.h" #include "nsIXULAppInfo.h" #include "nsIXULRuntime.h" +#include "nsKDEUtils.h" + using namespace mozilla; + struct ManifestDirective { -@@ -435,6 +436,7 @@ ParseManifestCommon(NSLocationType aType + const char* directive; + int argc; + +@@ -434,16 +435,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"); + NS_NAMED_LITERAL_STRING(kDesktop, "desktop"); + #if defined(ANDROID) + NS_NAMED_LITERAL_STRING(kTablet, "tablet"); + #endif // Obsolete NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers"); -@@ -479,6 +481,7 @@ ParseManifestCommon(NSLocationType aType + + nsAutoString appID; +@@ -481,41 +483,46 @@ ParseManifestCommon(NSLocationType aType + CopyUTF8toUTF16(s, abi); + abi.Insert(PRUnichar('_'), 0); + abi.Insert(osTarget, 0); + } + } } nsAutoString osVersion; @@ -3278,7 +3616,7 @@ diff -Naurp mozilla-release/xpcom/components/ManifestParser.cpp mozilla-release. #if defined(XP_WIN) OSVERSIONINFO info = { sizeof(OSVERSIONINFO) }; if (GetVersionEx(&info)) { -@@ -486,6 +489,7 @@ ParseManifestCommon(NSLocationType aType + nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), info.dwMajorVersion, info.dwMinorVersion); } @@ -3286,7 +3624,8 @@ diff -Naurp mozilla-release/xpcom/components/ManifestParser.cpp mozilla-release. #elif defined(MOZ_WIDGET_COCOA) SInt32 majorVersion, minorVersion; if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) && -@@ -494,14 +498,17 @@ ParseManifestCommon(NSLocationType aType + (Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr)) { + nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), majorVersion, minorVersion); } @@ -3297,22 +3636,35 @@ diff -Naurp mozilla-release/xpcom/components/ManifestParser.cpp mozilla-release. gtk_minor_version); + desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome"); #elif defined(ANDROID) + bool isTablet = false; if (mozilla::AndroidBridge::Bridge()) { mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", osVersion); + isTablet = mozilla::AndroidBridge::Bridge()->IsTablet(); } + desktop = NS_LITERAL_STRING("android"); #endif // Because contracts must be registered after CIDs, we save and process them -@@ -590,6 +597,7 @@ ParseManifestCommon(NSLocationType aType + // at the end. + nsTArray contracts; + + char *token; + char *newline = buf; +@@ -597,24 +604,26 @@ ParseManifestCommon(NSLocationType aType + TriState stOsVersion = eUnspecified; + TriState stOs = eUnspecified; TriState stABI = eUnspecified; + #if defined(ANDROID) + TriState stTablet = eUnspecified; + #endif bool platform = false; bool contentAccessible = false; + TriState stDesktop = eUnspecified; while (NULL != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && ok) { ToLowerCase(token); -@@ -598,6 +606,7 @@ ParseManifestCommon(NSLocationType aType + NS_ConvertASCIItoUTF16 wtoken(token); + if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || CheckStringFlag(kABI, wtoken, abi, stABI) || @@ -3320,18 +3672,38 @@ diff -Naurp mozilla-release/xpcom/components/ManifestParser.cpp mozilla-release. CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) || CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) -@@ -628,6 +637,7 @@ ParseManifestCommon(NSLocationType aType + continue; + + #if defined(ANDROID) + bool tablet = false; + if (CheckFlag(kTablet, wtoken, tablet)) { +@@ -643,16 +652,17 @@ ParseManifestCommon(NSLocationType aType + } + + if (!ok || + stApp == eBad || + stAppVersion == eBad || stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || + stDesktop == eBad || + #ifdef ANDROID + stTablet == eBad || + #endif stABI == eBad) continue; -diff -Naurp mozilla-release/xpcom/io/Makefile.in mozilla-release.oden/xpcom/io/Makefile.in ---- mozilla-release/xpcom/io/Makefile.in 2011-12-16 20:29:47.000000000 +0000 -+++ mozilla-release.oden/xpcom/io/Makefile.in 2011-12-21 07:57:54.000000000 +0000 -@@ -195,7 +195,7 @@ DEFINES += -DHAVE_USR_LIB64_DIR + if (directive->regfunc) { + if (GeckoProcessType_Default != XRE_GetProcessType()) +diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in +--- a/xpcom/io/Makefile.in ++++ b/xpcom/io/Makefile.in +@@ -190,17 +190,17 @@ include $(topsrcdir)/ipc/chromium/chromi + DEFINES += -D_IMPL_NS_COM + + ifeq ($(OS_ARCH),Linux) + ifneq (,$(findstring lib64,$(libdir))) + DEFINES += -DHAVE_USR_LIB64_DIR endif endif @@ -3340,18 +3712,38 @@ diff -Naurp mozilla-release/xpcom/io/Makefile.in mozilla-release.oden/xpcom/io/M ifeq ($(MOZ_PLATFORM_MAEMO),5) CFLAGS += $(MOZ_DBUS_CFLAGS) -diff -Naurp mozilla-release/xpcom/io/nsLocalFileUnix.cpp mozilla-release.oden/xpcom/io/nsLocalFileUnix.cpp ---- mozilla-release/xpcom/io/nsLocalFileUnix.cpp 2011-12-16 20:29:47.000000000 +0000 -+++ mozilla-release.oden/xpcom/io/nsLocalFileUnix.cpp 2011-12-21 07:57:54.000000000 +0000 -@@ -92,6 +92,7 @@ + CXXFLAGS += $(MOZ_DBUS_CFLAGS) + endif + + ifdef MOZ_PLATFORM_MAEMO + CFLAGS += $(MOZ_PLATFORM_MAEMO_CFLAGS) $(MOZ_QT_CFLAGS) +diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp +--- a/xpcom/io/nsLocalFileUnix.cpp ++++ b/xpcom/io/nsLocalFileUnix.cpp +@@ -90,16 +90,17 @@ + #include "prproces.h" + #include "nsIDirectoryEnumerator.h" + #include "nsISimpleEnumerator.h" + #include "private/pprio.h" + #ifdef MOZ_WIDGET_GTK2 #include "nsIGIOService.h" #include "nsIGnomeVFSService.h" +#include "nsKDEUtils.h" #endif - #ifdef XP_MACOSX -@@ -1790,21 +1791,13 @@ NS_IMETHODIMP + #ifdef MOZ_WIDGET_COCOA + #include + #include "CocoaFileUtils.h" + #include "prmem.h" + #include "plbase64.h" + +@@ -1795,44 +1796,51 @@ nsLocalFile::SetPersistentDescriptor(con + return InitWithNativePath(aPersistentDescriptor); + #endif + } + + NS_IMETHODIMP nsLocalFile::Reveal() { #ifdef MOZ_WIDGET_GTK2 @@ -3361,7 +3753,7 @@ diff -Naurp mozilla-release/xpcom/io/nsLocalFileUnix.cpp mozilla-release.oden/xp - return NS_ERROR_FAILURE; - + nsCAutoString url; - PRBool isDirectory; + bool isDirectory; if (NS_FAILED(IsDirectory(&isDirectory))) return NS_ERROR_FAILURE; @@ -3375,7 +3767,8 @@ diff -Naurp mozilla-release/xpcom/io/nsLocalFileUnix.cpp mozilla-release.oden/xp } else { nsCOMPtr parentDir; nsCAutoString dirPath; -@@ -1813,11 +1806,25 @@ nsLocalFile::Reveal() + if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) + return NS_ERROR_FAILURE; if (NS_FAILED(parentDir->GetNativePath(dirPath))) return NS_ERROR_FAILURE; @@ -3384,14 +3777,14 @@ diff -Naurp mozilla-release/xpcom/io/nsLocalFileUnix.cpp mozilla-release.oden/xp - else - return gnomevfs->ShowURIForInput(dirPath); + url = dirPath; -+ } + } + + if(nsKDEUtils::kdeSupport()) { -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); -+ command.AppendCString( url ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING("OPEN") ); ++ command.AppendElement( url ); + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; - } ++ } + + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + nsCOMPtr gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); @@ -3402,20 +3795,36 @@ diff -Naurp mozilla-release/xpcom/io/nsLocalFileUnix.cpp mozilla-release.oden/xp + return giovfs->ShowURIForInput(url); + else + return gnomevfs->ShowURIForInput(url); - #elif defined(XP_MACOSX) ++ + #elif defined(MOZ_WIDGET_COCOA) CFURLRef url; if (NS_SUCCEEDED(GetCFURL(&url))) { -@@ -1853,6 +1860,13 @@ nsLocalFile::Launch() + nsresult rv = CocoaFileUtils::RevealFileInFinder(url); + ::CFRelease(url); + return rv; + } + return NS_ERROR_FAILURE; +@@ -1858,16 +1866,23 @@ nsLocalFile::Launch() + + if (nsnull == connection) + return NS_ERROR_FAILURE; + + if (hildon_mime_open_file(connection, mPath.get()) != kHILDON_SUCCESS) return NS_ERROR_FAILURE; return NS_OK; #else + if( nsKDEUtils::kdeSupport()) { -+ nsCStringArray command; -+ command.AppendCString( NS_LITERAL_CSTRING( "OPEN" )); -+ command.AppendCString( mPath ); ++ nsTArray command; ++ command.AppendElement( NS_LITERAL_CSTRING("OPEN") ); ++ command.AppendElement( mPath ); + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; + } + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); nsCOMPtr gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); if (giovfs) { + return giovfs->ShowURIForInput(mPath); + } else if (gnomevfs) { + /* GnomeVFS fallback */ + return gnomevfs->ShowURIForInput(mPath); + }