diff -r a704b2a17e39 -r a2bdff616a0e mozilla-kde.patch --- a/mozilla-kde.patch Wed Apr 08 00:59:13 2015 +0200 +++ b/mozilla-kde.patch Sun May 10 09:05:36 2015 +0200 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 2b183c17f6e4693372442af1a8ee0be364f8cba0 +# Parent 214f99f3ce4f1f8ae9b3d18da44e5d66b3105663 Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak @@ -1836,8 +1836,8 @@ + secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) { + var psvc = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); -+ var instantApply = psvc.getBoolPref("browser.preferences.instantApply"); -+ if (instantApply) { ++ var pdocEl = window.opener.document.documentElement; ++ if (pdocEl.instantApply) { + var panes = this.preferencePanes; + for (var i = 0; i < panes.length; ++i) + panes[i].writePreferences(true); @@ -2136,7 +2136,7 @@ +#include "nsVoidArray.h" +#include "nsKDEUtils.h" - class nsUnixSystemProxySettings MOZ_FINAL : public nsISystemProxySettings { + class nsUnixSystemProxySettings final : public nsISystemProxySettings { public: NS_DECL_ISUPPORTS NS_DECL_NSISYSTEMPROXYSETTINGS @@ -2219,7 +2219,7 @@ diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build -@@ -43,17 +43,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt +@@ -45,17 +45,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt GENERATED_SOURCES += [ 'moc_nsNativeAppSupportQt.cpp', ] @@ -2666,9 +2666,9 @@ LOCAL_INCLUDES += [ '/dom/base', '/dom/ipc', - '/netwerk/base/src', + '/netwerk/base', '/netwerk/protocol/http', -+ '/toolkit/xre' ++ '/toolkit/xre', ] if CONFIG['MOZ_ENABLE_DBUS']: @@ -2904,7 +2904,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 -@@ -7,33 +7,36 @@ +@@ -7,32 +7,35 @@ #ifdef MOZ_WIDGET_QT #if (MOZ_ENABLE_CONTENTACTION) #include @@ -2918,7 +2918,6 @@ #include "nsIGIOService.h" #include "nsNetCID.h" #include "nsIIOService.h" - #include "nsIGnomeVFSService.h" #include "nsAutoPtr.h" #ifdef MOZ_ENABLE_DBUS #include "nsDBusHandlerApp.h" @@ -2943,7 +2942,7 @@ #endif return rv; -@@ -46,24 +49,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo +@@ -45,24 +48,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to // give the GNOME answer. if (mDefaultApplication) @@ -2951,7 +2950,7 @@ *_retval = false; - if (mClass == eProtocolInfo) { + if (mClass == eProtocolInfo) { - *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get()); + *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get()); } else { @@ -2971,7 +2970,7 @@ if (*_retval) return NS_OK; -@@ -98,16 +101,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns +@@ -97,16 +100,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get())); if (action.isValid()) { action.trigger(); @@ -2998,32 +2997,13 @@ + } + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); - nsAutoCString uriSpec; - if (giovfs) { - // 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; -@@ -125,17 +145,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns - /* Fallback to GnomeVFS */ - nsCOMPtr app; - if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app) - return app->Launch(nativePath); + if (!giovfs) { + return NS_ERROR_FAILURE; } - // If we haven't got an app we try to get a valid one by searching for the - // extension mapped type -- nsRefPtr mimeInfo = nsGNOMERegistry::GetFromExtension(nativePath); -+ nsRefPtr mimeInfo = nsCommonRegistry::GetFromExtension(nativePath); - if (mimeInfo) { - nsAutoCString type; - mimeInfo->GetType(type); - if (giovfs) { - nsCOMPtr app; - if (NS_SUCCEEDED(giovfs->GetAppForMimeType(type, getter_AddRefs(app))) && app) - return app->Launch(uriSpec); - } else if (gnomevfs) { + // nsGIOMimeApp->Launch wants a URI string instead of local file + nsresult rv; + nsCOMPtr ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); 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 @@ -3054,7 +3034,7 @@ #endif #ifdef MOZ_WIDGET_GTK - // Check the GConf registry for a protocol handler + // Check the GNOME registry for a protocol handler - *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme); + *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme); #endif @@ -3094,25 +3074,25 @@ rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, -@@ -1372,17 +1372,17 @@ nsOSHelperAppService::GetFromType(const +@@ -1373,17 +1373,17 @@ nsOSHelperAppService::GetFromType(const + nsAutoString extensions, mime_types_description; + LookUpExtensionsAndDescription(majorType, + minorType, + extensions, + mime_types_description); + #ifdef MOZ_WIDGET_GTK - nsRefPtr 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); -+ gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType); - if (gnomeInfo && gnomeInfo->HasExtensions()) { - LOG(("Got MIMEInfo from GNOME registry, and it has extensions set\n")); +- nsRefPtr gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType); ++ nsRefPtr gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType); + if (gnomeInfo) { + LOG(("Got MIMEInfo from GNOME registry without extensions; setting them " + "to %s\n", NS_LossyConvertUTF16toASCII(extensions).get())); + + NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?"); + gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions)); return gnomeInfo.forget(); } - } - #endif - - // Now look up our extensions diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build @@ -3465,7 +3445,7 @@ diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h --- a/widget/gtk/nsFilePicker.h +++ b/widget/gtk/nsFilePicker.h -@@ -66,11 +66,17 @@ protected: +@@ -68,11 +68,17 @@ protected: nsString mDefault; nsString mDefaultExtension; @@ -3504,9 +3484,9 @@ #define XPTONLY_MANIFEST nullptr #define XPTONLY_XPT nullptr #endif -@@ -488,16 +489,17 @@ ParseManifest(NSLocationType aType, File - NS_NAMED_LITERAL_STRING(kPlatform, "platform"); - NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible"); +@@ -489,16 +490,17 @@ ParseManifest(NSLocationType aType, File + NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled"); + NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired"); NS_NAMED_LITERAL_STRING(kApplication, "application"); NS_NAMED_LITERAL_STRING(kAppVersion, "appversion"); NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion"); @@ -3522,7 +3502,7 @@ NS_NAMED_LITERAL_STRING(kMain, "main"); NS_NAMED_LITERAL_STRING(kContent, "content"); -@@ -548,44 +550,49 @@ ParseManifest(NSLocationType aType, File +@@ -549,44 +551,49 @@ ParseManifest(NSLocationType aType, File CopyUTF8toUTF16(s, abi); abi.Insert(char16_t('_'), 0); abi.Insert(osTarget, 0); @@ -3573,14 +3553,14 @@ } @@ -681,25 +688,27 @@ ParseManifest(NSLocationType aType, File + TriState stOsVersion = eUnspecified; TriState stOs = eUnspecified; TriState stABI = eUnspecified; TriState stProcess = eUnspecified; #if defined(MOZ_WIDGET_ANDROID) TriState stTablet = eUnspecified; #endif - bool platform = false; - bool contentAccessible = false; + int flags = 0; + TriState stDesktop = eUnspecified; while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && @@ -3600,7 +3580,7 @@ } #if defined(MOZ_WIDGET_ANDROID) -@@ -731,16 +740,17 @@ ParseManifest(NSLocationType aType, File +@@ -749,16 +758,17 @@ ParseManifest(NSLocationType aType, File } if (!ok || @@ -3638,7 +3618,8 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp -@@ -45,16 +45,17 @@ +@@ -44,16 +44,17 @@ + #include "prproces.h" #include "nsIDirectoryEnumerator.h" #include "nsISimpleEnumerator.h" #include "private/pprio.h" @@ -3646,7 +3627,6 @@ #ifdef MOZ_WIDGET_GTK #include "nsIGIOService.h" - #include "nsIGnomeVFSService.h" +#include "nsKDEUtils.h" #endif @@ -3656,7 +3636,7 @@ #include "prmem.h" #include "plbase64.h" -@@ -1965,55 +1966,57 @@ nsLocalFile::SetPersistentDescriptor(con +@@ -1964,42 +1965,52 @@ nsLocalFile::SetPersistentDescriptor(con return InitWithNativePath(aPersistentDescriptor); #endif } @@ -3666,14 +3646,11 @@ { #ifdef MOZ_WIDGET_GTK - nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); -- nsCOMPtr gnomevfs = -- do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); -- if (!giovfs && !gnomevfs) { +- if (!giovfs) { - return NS_ERROR_FAILURE; - } -- -+ + nsAutoCString url; + bool isDirectory; if (NS_FAILED(IsDirectory(&isDirectory))) { return NS_ERROR_FAILURE; @@ -3681,16 +3658,9 @@ + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); if (isDirectory) { -- if (giovfs) { -- return giovfs->ShowURIForInput(mPath); -- } else -- /* Fallback to GnomeVFS */ -- { -- return gnomevfs->ShowURIForInput(mPath); -- } +- return giovfs->ShowURIForInput(mPath); + url = mPath; - } else if (giovfs && - NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) { + } else if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) { return NS_OK; } else { nsCOMPtr parentDir; @@ -3702,11 +3672,7 @@ return NS_ERROR_FAILURE; } -- if (giovfs) { -- return giovfs->ShowURIForInput(dirPath); -- } else { -- return gnomevfs->ShowURIForInput(dirPath); -- } +- return giovfs->ShowURIForInput(dirPath); + url = dirPath; } + @@ -3717,14 +3683,10 @@ + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; + } + -+ nsCOMPtr gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID); -+ if (!giovfs && !gnomevfs) ++ if (!giovfs) + return NS_ERROR_FAILURE; + -+ if (giovfs) -+ return giovfs->ShowURIForInput(url); -+ else -+ return gnomevfs->ShowURIForInput(url); ++ return giovfs->ShowURIForInput(url); #elif defined(MOZ_WIDGET_COCOA) CFURLRef url; if (NS_SUCCEEDED(GetCFURL(&url))) { @@ -3733,7 +3695,7 @@ return rv; } return NS_ERROR_FAILURE; -@@ -2021,16 +2024,22 @@ nsLocalFile::Reveal() +@@ -2007,16 +2018,22 @@ nsLocalFile::Reveal() return NS_ERROR_FAILURE; #endif } @@ -3749,10 +3711,10 @@ + 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); + if (!giovfs) { + return NS_ERROR_FAILURE; + } + + return giovfs->ShowURIForInput(mPath); + #elif defined(MOZ_ENABLE_CONTENTACTION) + QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(mPath.get()));