1
0

- update to Thunderbird 24.0 (bnc#840485)

- require NSPR 4.10 and NSS 3.15.1
- add GStreamer build requirements for Gecko
- added enigmail-build.patch to fix TB packaging (bmo#886095)
- removed obsolete patches:
  * enigmail-old-gcc.patch
  * mozilla-gcc43-enums.patch
  * mozilla-gcc43-template_hacks.patch
  * mozilla-gcc43-templates_instantiation.patch
  * ppc-xpcshell.patch

OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaThunderbird?expand=0&rev=222
This commit is contained in:
Wolfgang Rosenauer
2013-09-16 09:26:56 +00:00
committed by Git OBS Bridge
parent ffa346f8d7
commit 1cbaa007b0
21 changed files with 349 additions and 541 deletions

View File

@@ -7,7 +7,7 @@ Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
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
@@ -45,14 +45,16 @@ GREPREF_FILES = $(topsrcdir)/netwerk/bas
@@ -49,14 +49,15 @@ endif
# Optimizer bug with GCC 3.2.2 on OS/2
ifeq ($(OS_ARCH), OS2)
nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp
@@ -17,9 +17,8 @@ diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in
endif
+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
+
greprefs.js: $(GREPREF_FILES)
greprefs.js: $(grepref_files)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ > $@
libs:: greprefs.js
@@ -39,13 +38,13 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
+#include "nsKDEUtils.h"
#include "nsQuickSort.h"
#include "prmem.h"
#include "pldhash.h"
#include "prefapi.h"
#include "prefread.h"
#include "prefapi_private_data.h"
@@ -896,16 +897,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
@@ -972,16 +973,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
static nsresult pref_LoadPrefsInDirList(const char *listId)
{
@@ -80,9 +79,9 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
return NS_OK;
bool hasMore;
@@ -921,17 +940,17 @@ static nsresult pref_LoadPrefsInDirList(
@@ -997,17 +1016,17 @@ static nsresult pref_LoadPrefsInDirList(
nsCAutoString leaf;
nsAutoCString leaf;
path->GetNativeLeafName(leaf);
// Do we care if a file provided by this process fails to load?
@@ -99,7 +98,7 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
{
nsZipItemPtr<char> manifest(jarReader, name, true);
NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
@@ -1025,28 +1044,40 @@ static nsresult pref_InitInitialObjects(
@@ -1101,28 +1120,40 @@ static nsresult pref_InitInitialObjects(
/* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
static const char* specialFiles[] = {
#if defined(XP_MACOSX)
@@ -140,26 +139,67 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
// or jar:$gre/omni.jar!/defaults/preferences/*.js.
nsRefPtr<nsZipArchive> appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
// GetReader(mozilla::Omnijar::APP) returns null when $app == $gre, in which
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
--- a/python/mozbuild/mozpack/chrome/flags.py
+++ b/python/mozbuild/mozpack/chrome/flags.py
@@ -208,16 +208,17 @@ class Flags(OrderedDict):
'platformversion': VersionFlag,
'contentaccessible': Flag,
'os': StringFlag,
'osversion': VersionFlag,
'abi': StringFlag,
'platform': Flag,
'xpcnativewrappers': Flag,
'tablet': Flag,
+ 'desktop': StringFlag,
}
RE = re.compile(r'([!<>=]+)')
def __init__(self, *flags):
'''
Initialize a set of flags given in string form.
flags = Flags('contentaccessible=yes', 'appversion>=3.5')
'''
diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py
--- a/python/mozbuild/mozpack/chrome/manifest.py
+++ b/python/mozbuild/mozpack/chrome/manifest.py
@@ -30,16 +30,17 @@ class ManifestEntry(object):
allowed_flags = [
'application',
'platformversion',
'os',
'osversion',
'abi',
'xpcnativewrappers',
'tablet',
+ 'desktop',
]
def __init__(self, base, *flags):
'''
Initialize a manifest entry with the given base path and flags.
'''
self.base = base
self.flags = Flags(*flags)
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
@@ -41,9 +41,12 @@ EXTRA_COMPONENTS = \
@@ -23,9 +23,11 @@ ifndef MOZ_SUITE
DISABLED_EXTRA_COMPONENTS = \
nsDownloadManagerUI.js \
nsDownloadManagerUI.manifest \
$(NULL)
endif
TEST_DIRS += test
include $(topsrcdir)/config/rules.mk
+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
+
+
CXXFLAGS += $(TK_CFLAGS)
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
@@ -35,16 +35,20 @@
@@ -38,16 +38,20 @@
#ifdef XP_WIN
#include <shlobj.h>
@@ -180,7 +220,7 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
#include "AndroidBridge.h"
#endif
@@ -2233,16 +2237,25 @@ nsDownload::SetState(DownloadState aStat
@@ -2609,16 +2613,25 @@ nsDownload::SetState(DownloadState aStat
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
// Master pref to control this function.
@@ -194,7 +234,7 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
+ command.AppendElement( NS_LITERAL_CSTRING( "DOWNLOADFINISHED" ));
+ nsAutoString displayName;
+ GetDisplayName( displayName );
+ command.AppendElement( nsCAutoString( ToNewUTF8String( displayName )));
+ command.AppendElement( nsAutoCString( ToNewUTF8String( displayName )));
+ nsKDEUtils::command( command );
+ } else {
+ // begin non-KDE block
@@ -206,15 +246,15 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
int64_t goat = PR_Now() - mStartTime;
showTaskbarAlert = goat > alertIntervalUSec;
@@ -2266,19 +2279,20 @@ nsDownload::SetState(DownloadState aStat
// If downloads are automatically removed per the user's
@@ -2645,19 +2658,20 @@ nsDownload::SetState(DownloadState aStat
// retention policy, there's no reason to make the text clickable
// because if it is, they'll click open the download manager and
// the items they downloaded will have been removed.
alerts->ShowAlertNotification(
NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
message, !removeWhenDone, EmptyString(), mDownloadManager,
EmptyString());
message, !removeWhenDone,
mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"), EmptyString());
- }
+ }
}
@@ -231,7 +271,7 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -45,29 +45,33 @@ toolkit.jar:
@@ -50,29 +50,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)
@@ -259,12 +299,12 @@ diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
+% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde
content/global/bindings/progressmeter.xml (widgets/progressmeter.xml)
content/global/bindings/radio.xml (widgets/radio.xml)
content/global/bindings/remote-browser.xml (widgets/remote-browser.xml)
content/global/bindings/resizer.xml (widgets/resizer.xml)
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
@@ -1366,7 +1406,7 @@ new file mode 100644
+ if (this.lastSelected) {
+ lastPane = document.getElementById(this.lastSelected);
+ if (!lastPane) {
+ this.lastSelected = null;
+ this.lastSelected = "";
+ }
+ }
+
@@ -2068,8 +2108,7 @@ new file mode 100644
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
@@ -13,16 +13,19 @@
#include "prnetdb.h"
@@ -14,16 +14,18 @@
#include "prenv.h"
#include "nsPrintfCString.h"
#include "nsNetUtil.h"
@@ -2077,9 +2116,9 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
#include "nsIGSettingsService.h"
#include "nsInterfaceHashtable.h"
#include "mozilla/Attributes.h"
#include "nsIURI.h"
+#include "nsVoidArray.h"
+#include "nsKDEUtils.h"
+
class nsUnixSystemProxySettings MOZ_FINAL : public nsISystemProxySettings {
public:
@@ -2088,7 +2127,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
nsUnixSystemProxySettings() {}
nsresult Init();
@@ -34,16 +37,17 @@ private:
@@ -35,16 +37,17 @@ private:
nsCOMPtr<nsIGSettingsService> mGSettings;
nsCOMPtr<nsIGSettingsCollection> mProxySettings;
nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> mSchemeProxySettings;
@@ -2102,31 +2141,31 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
nsresult
nsUnixSystemProxySettings::Init()
NS_IMETHODIMP
nsUnixSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly)
{
// If this is a GNOME session, load gconf and try to use its preferences.
@@ -496,16 +500,19 @@ nsUnixSystemProxySettings::GetProxyForUR
nsCAutoString host;
rv = aURI->GetHost(host);
NS_ENSURE_SUCCESS(rv, rv);
// dbus prevents us from being threadsafe, but this routine should not block anyhow
@@ -496,16 +499,19 @@ nsUnixSystemProxySettings::GetProxyFromG
int32_t port;
rv = aURI->GetPort(&port);
NS_ENSURE_SUCCESS(rv, rv);
+ if( nsKDEUtils::kdeSupport())
+ return GetProxyFromKDE(scheme, host, port, aResult);
nsresult
nsUnixSystemProxySettings::GetProxyForURI(const nsACString & aSpec,
const nsACString & aScheme,
const nsACString & aHost,
const int32_t aPort,
nsACString & aResult)
{
+ if (nsKDEUtils::kdeSupport())
+ return GetProxyFromKDE(aScheme, aHost, aPort, aResult);
+
if (mProxySettings) {
rv = GetProxyFromGSettings(scheme, host, port, aResult);
if (rv == NS_OK)
nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
if (NS_SUCCEEDED(rv))
return rv;
}
if (mGConf)
return GetProxyFromGConf(scheme, host, port, aResult);
return GetProxyFromGConf(aScheme, aHost, aPort, aResult);
@@ -531,8 +538,34 @@ static const mozilla::Module::ContractID
@@ -531,8 +537,34 @@ static const mozilla::Module::ContractID
static const mozilla::Module kUnixProxyModule = {
mozilla::Module::kVersion,
@@ -2142,7 +2181,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
+ PRInt32 aPort,
+ nsACString& aResult)
+{
+ nsCAutoString url;
+ nsAutoCString url;
+ url = aScheme;
+ url += "://";
+ url += aHost;
@@ -2161,34 +2200,35 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
+ return NS_OK;
+}
+
diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -69,17 +69,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)
-CPPSRCS += nsNativeAppSupportUnix.cpp
+CPPSRCS += nsNativeAppSupportUnix.cpp nsKDEUtils.cpp
+EXPORTS += nsKDEUtils.h
else
ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
MOCSRCS += moc_nsNativeAppSupportQt.cpp
CPPSRCS += $(MOCSRCS)
CPPSRCS += nsNativeAppSupportQt.cpp
CPPSRCS += nsQAppInstance.cpp
EXPORTS += nsQAppInstance.h
else
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -38,18 +38,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt
'nsNativeAppSupportQt.cpp',
'nsQAppInstance.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'os2':
CPP_SOURCES += [
'nsNativeAppSupportOS2.cpp',
]
elif CONFIG['MOZ_ENABLE_GTK']:
+ EXPORTS += ['nsKDEUtils.h']
CPP_SOURCES += [
'nsNativeAppSupportUnix.cpp',
+ 'nsKDEUtils.cpp'
]
else:
CPP_SOURCES += [
'nsNativeAppSupportDefault.cpp',
]
if CONFIG['MOZ_X11']:
CPP_SOURCES += [
diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
new file mode 100644
--- /dev/null
+++ b/toolkit/xre/nsKDEUtils.cpp
@@ -0,0 +1,341 @@
@@ -0,0 +1,339 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -2321,7 +2361,7 @@ new file mode 100644
+ *eol = '\0';
+ command_done = ( strcmp( buf, "\\1" ) == 0 );
+ command_failed = ( strcmp( buf, "\\0" ) == 0 );
+ nsCAutoString line( buf );
+ nsAutoCString line( buf );
+ line.ReplaceSubstring( "\\n", "\n" );
+ line.ReplaceSubstring( "\\" "\\", "\\" ); // \\ -> \ , i.e. unescape
+ if( p->output && !( command_done || command_failed ))
@@ -2354,8 +2394,6 @@ new file mode 100644
+
+bool nsKDEUtils::command( nsIArray* command, nsIArray** output)
+ {
+ NS_ENSURE_ARG( command );
+
+ nsTArray<nsCString> in;
+ PRUint32 length;
+ command->GetLength( &length );
@@ -2364,7 +2402,7 @@ new file mode 100644
+ nsCOMPtr<nsISupportsCString> str = do_QueryElementAt( command, i );
+ if( str )
+ {
+ nsCAutoString s;
+ nsAutoCString s;
+ str->GetData( s );
+ in.AppendElement( s );
+ }
@@ -2586,27 +2624,39 @@ new file mode 100644
diff --git a/uriloader/exthandler/Makefile.in b/uriloader/exthandler/Makefile.in
--- a/uriloader/exthandler/Makefile.in
+++ b/uriloader/exthandler/Makefile.in
@@ -58,18 +58,19 @@ LOCAL_INCLUDES = -I$(srcdir)
LOCAL_INCLUDES += -I$(topsrcdir)/dom/base \
-I$(topsrcdir)/dom/ipc \
-I$(topsrcdir)/content/base/src \
-I$(topsrcdir)/content/events/src \
-I$(topsrcdir)/netwerk/base/src \
-I$(topsrcdir)/netwerk/protocol/http
@@ -86,9 +86,10 @@ EXTRA_COMPONENTS = \
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
-OSHELPER += nsGNOMERegistry.cpp
+OSHELPER += nsCommonRegistry.cpp nsGNOMERegistry.cpp nsKDERegistry.cpp
OSHELPER += nsMIMEInfoUnix.cpp
ifneq (,$(filter qt gtk2 gtk3, $(MOZ_WIDGET_TOOLKIT)))
CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
endif
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -68,16 +68,18 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
pass
else:
CPP_SOURCES += [
'nsOSHelperAppService.cpp',
]
ifeq ($(MOZ_WIDGET_TOOLKIT),android)
OSHELPER += nsMIMEInfoAndroid.cpp
OSHELPER += nsAndroidHandlerApp.cpp
OSHELPER += nsExternalSharingAppService.cpp
EXPORTS += nsExternalSharingAppService.h
OSHELPER += nsExternalURLHandlerService.cpp
if CONFIG['MOZ_ENABLE_GTK']:
CPP_SOURCES += [
+ 'nsCommonRegistry.cpp',
+ 'nsKDERegistry.cpp',
'nsGNOMERegistry.cpp',
'nsMIMEInfoUnix.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
CPP_SOURCES += [
'nsMIMEInfoAndroid.cpp',
'nsAndroidHandlerApp.cpp',
'nsExternalSharingAppService.cpp',
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
new file mode 100644
--- /dev/null
@@ -2625,7 +2675,7 @@ new file mode 100644
+#include "nsVoidArray.h"
+#include "nsKDEUtils.h"
+
+/* static */ PRBool
+/* static */ bool
+nsCommonRegistry::HandlerExists(const char *aProtocolScheme)
+{
+ if( nsKDEUtils::kdeSupport())
@@ -2683,7 +2733,7 @@ new file mode 100644
+class nsCommonRegistry
+{
+ public:
+ static PRBool HandlerExists(const char *aProtocolScheme);
+ static bool HandlerExists(const char *aProtocolScheme);
+
+ static nsresult LoadURL(nsIURI *aURL);
+
@@ -2698,7 +2748,7 @@ diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/
new file mode 100644
--- /dev/null
+++ b/uriloader/exthandler/unix/nsKDERegistry.cpp
@@ -0,0 +1,86 @@
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -2713,12 +2763,12 @@ new file mode 100644
+#include "nsAutoPtr.h"
+#include "nsKDEUtils.h"
+
+/* static */ PRBool
+/* static */ bool
+nsKDERegistry::HandlerExists(const char *aProtocolScheme)
+{
+ nsTArray<nsCString> command;
+ command.AppendElement( NS_LITERAL_CSTRING( "HANDLEREXISTS" ));
+ command.AppendElement( nsCAutoString( aProtocolScheme ));
+ command.AppendElement( nsAutoCString( aProtocolScheme ));
+ return nsKDEUtils::command( command );
+}
+
@@ -2730,7 +2780,11 @@ new file mode 100644
+ nsCString url;
+ aURL->GetSpec( url );
+ command.AppendElement( url );
+ return nsKDEUtils::command( command );
+ bool rv = nsKDEUtils::command( command );
+ if (!rv)
+ return NS_ERROR_FAILURE;
+
+ return NS_OK;
+}
+
+/* static */ void
@@ -2779,9 +2833,7 @@ new file mode 100644
+ nsCString handlerAppName = output[ 2 ];
+ mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName));
+ mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
+ nsMIMEInfoBase* retval;
+ NS_ADDREF((retval = mimeInfo));
+ return retval;
+ return mimeInfo.forget();
+ }
+ return nullptr;
+}
@@ -2799,13 +2851,13 @@ new file mode 100644
+#include "nsTArray.h"
+
+class nsMIMEInfoBase;
+class nsCAutoString;
+class nsAutoCString;
+class nsCString;
+
+class nsKDERegistry
+{
+ public:
+ static PRBool HandlerExists(const char *aProtocolScheme);
+ static bool HandlerExists(const char *aProtocolScheme);
+
+ static nsresult LoadURL(nsIURI *aURL);
+
@@ -2855,22 +2907,22 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
if (NS_FAILED(rv)){
HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nullptr);
if (action) {
nsCAutoString spec;
nsAutoCString spec;
aURI->GetAsciiSpec(spec);
if (hildon_uri_open(spec.get(), action, nullptr))
@@ -61,22 +64,22 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI *
return rv;
}
NS_IMETHODIMP
nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
@@ -67,22 +70,22 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
{
// if mDefaultApplication is set, it means the application has been set from
// either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
// give the GNOME answer.
if (mDefaultApplication)
return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
*_retval = false;
- nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
+ nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType);
if (!mimeInfo) {
nsCAutoString ext;
nsAutoCString ext;
nsresult rv = GetPrimaryExtension(ext);
if (NS_SUCCEEDED(rv)) {
- mimeInfo = nsGNOMERegistry::GetFromExtension(ext);
@@ -2883,7 +2935,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
if (*_retval)
return NS_OK;
@@ -119,16 +122,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
@@ -130,16 +133,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
if (action.isValid()) {
action.trigger();
@@ -2910,14 +2962,14 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
+ }
+
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
nsCAutoString uriSpec;
nsAutoCString uriSpec;
if (giovfs) {
// nsGIOMimeApp->Launch wants a URI string instead of local file
nsresult rv;
nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIURI> uri;
@@ -146,17 +166,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
@@ -157,17 +177,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
/* Fallback to GnomeVFS */
nsCOMPtr<nsIGnomeVFSMimeApp> app;
if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app)
@@ -2929,7 +2981,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
- nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromExtension(nativePath);
+ nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromExtension(nativePath);
if (mimeInfo) {
nsCAutoString type;
nsAutoCString type;
mimeInfo->GetType(type);
if (giovfs) {
nsCOMPtr<nsIGIOMimeApp> app;
@@ -2947,7 +2999,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
#include "nsOSHelperAppService.h"
#include "nsMIMEInfoUnix.h"
#ifdef MOZ_WIDGET_GTK2
#ifdef MOZ_WIDGET_GTK
-#include "nsGNOMERegistry.h"
+#include "nsCommonRegistry.h"
#endif
@@ -2965,7 +3017,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
*aHandlerExists = true;
#endif
#ifdef MOZ_WIDGET_GTK2
#ifdef MOZ_WIDGET_GTK
// Check the GConf registry for a protocol handler
- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
+ *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme);
@@ -2979,7 +3031,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval)
{
#ifdef MOZ_WIDGET_GTK2
#ifdef MOZ_WIDGET_GTK
- nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval);
+ nsCommonRegistry::GetAppDescForScheme(aScheme, _retval);
return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
@@ -2990,39 +3042,39 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
nsresult nsOSHelperAppService::GetFileTokenForPath(const PRUnichar * platformAppPath, nsIFile ** aFile)
{
@@ -1265,17 +1265,17 @@ nsOSHelperAppService::GetFromExtension(c
minorType,
@@ -1266,17 +1266,17 @@ nsOSHelperAppService::GetFromExtension(c
mime_types_description,
true);
if (NS_FAILED(rv) || majorType.IsEmpty()) {
#ifdef MOZ_WIDGET_GTK2
#ifdef MOZ_WIDGET_GTK
LOG(("Looking in GNOME registry\n"));
- nsMIMEInfoBase *gnomeInfo = nsGNOMERegistry::GetFromExtension(aFileExt).get();
+ nsMIMEInfoBase *gnomeInfo = nsCommonRegistry::GetFromExtension(aFileExt).get();
nsRefPtr<nsMIMEInfoBase> gnomeInfo =
- nsGNOMERegistry::GetFromExtension(aFileExt);
+ nsCommonRegistry::GetFromExtension(aFileExt);
if (gnomeInfo) {
LOG(("Got MIMEInfo from GNOME registry\n"));
return gnomeInfo;
return gnomeInfo.forget();
}
#endif
rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
majorType,
@@ -1391,17 +1391,17 @@ nsOSHelperAppService::GetFromType(const
#ifdef MOZ_WIDGET_GTK2
nsMIMEInfoBase *gnomeInfo = nullptr;
@@ -1389,17 +1389,17 @@ nsOSHelperAppService::GetFromType(const
#ifdef MOZ_WIDGET_GTK
nsRefPtr<nsMIMEInfoBase> gnomeInfo;
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"));
- gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType).get();
+ gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType).get();
- gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
+ gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType);
if (gnomeInfo && gnomeInfo->HasExtensions()) {
LOG(("Got MIMEInfo from GNOME registry, and it has extensions set\n"));
return gnomeInfo;
return gnomeInfo.forget();
}
}
#endif
@@ -3031,7 +3083,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
diff --git a/widget/gtk2/Makefile.in b/widget/gtk2/Makefile.in
--- a/widget/gtk2/Makefile.in
+++ b/widget/gtk2/Makefile.in
@@ -104,11 +104,14 @@ DEFINES += -DCAIRO_GFX -DMOZ_APP_NAME='
@@ -67,11 +67,14 @@ DEFINES += -DCAIRO_GFX -DMOZ_APP_NAME='
INCLUDES += \
-I$(srcdir)/../xpwidgets \
@@ -3049,7 +3101,7 @@ diff --git a/widget/gtk2/Makefile.in b/widget/gtk2/Makefile.in
diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
--- a/widget/gtk2/nsFilePicker.cpp
+++ b/widget/gtk2/nsFilePicker.cpp
@@ -1,16 +1,17 @@
@@ -1,31 +1,33 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -3067,14 +3119,12 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
#include "nsIStringBundle.h"
#include "nsArrayEnumerator.h"
@@ -19,16 +20,17 @@
#include "nsMemory.h"
#include "nsEnumeratorUtils.h"
#include "nsNetUtil.h"
#include "nsReadableUtils.h"
#include "mozcontainer.h"
#include "prmem.h"
#include "prlink.h"
#include "nsFilePicker.h"
+#include "nsKDEUtils.h"
@@ -3085,7 +3135,7 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
using namespace mozilla;
#define MAX_PREVIEW_SIZE 180
@@ -264,17 +266,19 @@ nsFilePicker::AppendFilters(int32_t aFil
@@ -242,17 +244,19 @@ nsFilePicker::AppendFilters(int32_t aFil
return nsBaseFilePicker::AppendFilters(aFilterMask);
}
@@ -3097,16 +3147,16 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
- return NS_OK;
+ // Unless it's KDE.
+ if( mMode != modeOpen || !nsKDEUtils::kdeSupport())
+ return NS_OK;
+ return NS_OK;
}
nsCAutoString filter, name;
nsAutoCString filter, name;
CopyUTF16toUTF8(aFilter, filter);
CopyUTF16toUTF8(aTitle, name);
mFilters.AppendElement(filter);
mFilterNames.AppendElement(name);
@@ -388,16 +392,32 @@ nsFilePicker::Show(int16_t *aReturn)
@@ -366,16 +370,32 @@ nsFilePicker::Show(int16_t *aReturn)
NS_IMETHODIMP
nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
@@ -3134,12 +3184,12 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
nsXPIDLCString title;
title.Adopt(ToNewUTF8String(mTitle));
GtkWindow *parent_widget = get_gtk_window_for_nsiwidget(mParentWidget);
GtkWindow *parent_widget =
GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
? GTK_STOCK_SAVE : GTK_STOCK_OPEN;
@@ -587,8 +607,235 @@ nsFilePicker::Done(GtkWidget* file_choos
@@ -567,8 +587,235 @@ nsFilePicker::Done(GtkWidget* file_choos
if (mCallback) {
mCallback->Done(result);
mCallback = nullptr;
@@ -3167,7 +3217,7 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
+
+static PRInt32 windowToXid( nsIWidget* widget )
+ {
+ GtkWindow *parent_widget = get_gtk_window_for_nsiwidget( widget );
+ GtkWindow *parent_widget = GTK_WINDOW(widget->GetNativeData(NS_NATIVE_SHELLWIDGET));
+ GdkWindow* gdk_window = gtk_widget_get_window( gtk_widget_get_toplevel( GTK_WIDGET( parent_widget )));
+ return GDK_WINDOW_XID( gdk_window );
+ }
@@ -3216,14 +3266,14 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
+ }
+ }
+
+ nsCAutoString directory;
+ nsAutoCString directory;
+ if (mDisplayDirectory) {
+ mDisplayDirectory->GetNativePath(directory);
+ } else if (mPrevDisplayDirectory) {
+ mPrevDisplayDirectory->GetNativePath(directory);
+ }
+
+ nsCAutoString startdir;
+ nsAutoCString startdir;
+ if (!directory.IsEmpty()) {
+ startdir = directory;
+ }
@@ -3239,7 +3289,7 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
+ if( startdir.IsEmpty())
+ startdir = ".";
+
+ nsCAutoString filters;
+ nsAutoCString filters;
+ PRInt32 count = mFilters.Length();
+ if( count == 0 ) //just in case
+ filters = "*";
@@ -3254,12 +3304,12 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
+ }
+
+ nsTArray<nsCString> command;
+ command.AppendElement( nsCAutoString( arg ));
+ command.AppendElement( nsAutoCString( arg ));
+ command.AppendElement( startdir );
+ if( mMode != nsIFilePicker::modeGetFolder )
+ {
+ command.AppendElement( filters );
+ nsCAutoString selected;
+ nsAutoCString selected;
+ selected.AppendInt( mSelectedType );
+ command.AppendElement( selected );
+ }
@@ -3269,13 +3319,13 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
+ if( PRInt32 xid = windowToXid( mParentWidget ))
+ {
+ command.AppendElement( NS_LITERAL_CSTRING( "PARENT" ));
+ nsCAutoString parent;
+ nsAutoCString parent;
+ parent.AppendInt( xid );
+ command.AppendElement( parent );
+ }
+
+ nsTArray<nsCString> output;
+ if( nsKDEUtils::commandBlockUi( command, get_gtk_window_for_nsiwidget( mParentWidget ), &output ))
+ if( nsKDEUtils::commandBlockUi( command, GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), &output ))
+ {
+ *aReturn = nsIFilePicker::returnOK;
+ mFiles.Clear();
@@ -3357,13 +3407,13 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
+ if( PRInt32 xid = windowToXid( mParentWidget ))
+ {
+ command.AppendElement( NS_LITERAL_CSTRING( "PARENT" ));
+ nsCAutoString parent;
+ nsAutoCString parent;
+ parent.AppendInt( xid );
+ command.AppendElement( parent );
+ }
+
+ nsTArray<nsCString> output;
+ if( nsKDEUtils::commandBlockUi( command, get_gtk_window_for_nsiwidget( mParentWidget ), &output ))
+ if( nsKDEUtils::commandBlockUi( command, GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), &output ))
+ {
+ *aReturn = nsIFilePicker::returnOK;
+ mFileURL = output.Length() > 0 ? output[ 0 ] : nsCString();
@@ -3399,17 +3449,16 @@ diff --git a/widget/gtk2/nsFilePicker.h b/widget/gtk2/nsFilePicker.h
diff --git a/xpcom/components/Makefile.in b/xpcom/components/Makefile.in
--- a/xpcom/components/Makefile.in
+++ b/xpcom/components/Makefile.in
@@ -59,10 +59,11 @@ LOCAL_INCLUDES = \
# we don't want the shared lib, but we want to force the creation of a static lib.
@@ -28,9 +28,10 @@ LOCAL_INCLUDES = \
FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/rules.mk
DEFINES += -D_IMPL_NS_COM
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
ifdef MOZ_WIDGET_GTK
CXXFLAGS += $(TK_CFLAGS)
+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
CXXFLAGS += $(MOZ_GTK2_CFLAGS)
endif
diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
--- a/xpcom/components/ManifestParser.cpp
@@ -3477,7 +3526,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
minorVersion);
}
+ desktop = NS_LITERAL_STRING("macosx");
#elif defined(MOZ_WIDGET_GTK2)
#elif defined(MOZ_WIDGET_GTK)
nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
gtk_major_version,
gtk_minor_version);
@@ -3545,7 +3594,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in
--- a/xpcom/io/Makefile.in
+++ b/xpcom/io/Makefile.in
@@ -157,17 +157,17 @@ include $(topsrcdir)/ipc/chromium/chromi
@@ -43,17 +43,17 @@ include $(topsrcdir)/ipc/chromium/chromi
DEFINES += -D_IMPL_NS_COM
ifeq ($(OS_ARCH),Linux)
@@ -3567,7 +3616,7 @@ diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -49,16 +49,17 @@
@@ -50,16 +50,17 @@
#include "prproces.h"
#include "nsIDirectoryEnumerator.h"
#include "nsISimpleEnumerator.h"
@@ -3585,7 +3634,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
#include "prmem.h"
#include "plbase64.h"
@@ -1760,44 +1761,51 @@ nsLocalFile::SetPersistentDescriptor(con
@@ -1753,44 +1754,51 @@ nsLocalFile::SetPersistentDescriptor(con
return InitWithNativePath(aPersistentDescriptor);
#endif
}
@@ -3599,7 +3648,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
- if (!giovfs && !gnomevfs)
- return NS_ERROR_FAILURE;
-
+ nsCAutoString url;
+ nsAutoCString url;
bool isDirectory;
if (NS_FAILED(IsDirectory(&isDirectory)))
return NS_ERROR_FAILURE;
@@ -3613,7 +3662,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
+ url = mPath;
} else {
nsCOMPtr<nsIFile> parentDir;
nsCAutoString dirPath;
nsAutoCString dirPath;
if (NS_FAILED(GetParent(getter_AddRefs(parentDir))))
return NS_ERROR_FAILURE;
if (NS_FAILED(parentDir->GetNativePath(dirPath)))
@@ -3651,7 +3700,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
return rv;
}
return NS_ERROR_FAILURE;
@@ -1823,16 +1831,23 @@ nsLocalFile::Launch()
@@ -1816,16 +1824,23 @@ nsLocalFile::Launch()
if (nullptr == connection)
return NS_ERROR_FAILURE;