--- mozilla/browser/app/Makefile.in.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/app/Makefile.in.sav 2009-09-05 00:10:42.000000000 +0200 @@ -49,6 +49,7 @@ DIRS = profile/extensions PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \ $(srcdir)/profile/channel-prefs.js \ + $(srcdir)/profile/kde.js \ $(NULL) ifndef MOZ_BRANDING_DIRECTORY --- mozilla/browser/app/profile/kde.js.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/app/profile/kde.js.sav 2009-09-05 00:10:42.000000000 +0200 @@ -0,0 +1, @@ +pref("browser.preferences.instantApply", false); --- mozilla/browser/components/build/nsModule.cpp.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/components/build/nsModule.cpp.sav 2009-09-05 00:10:42.000000000 +0200 @@ -46,7 +46,7 @@ #elif defined(XP_MACOSX) #include "nsMacShellService.h" #elif defined(MOZ_WIDGET_GTK2) -#include "nsGNOMEShellService.h" +#include "nsUnixShellService.h" #endif #ifndef WINCE @@ -88,7 +88,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindows #elif defined(XP_MACOSX) NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService) #elif defined(MOZ_WIDGET_GTK2) -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init) +// in nsUnixShellService +//NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixShellService, Init) #endif #ifndef WINCE @@ -132,7 +133,7 @@ static const nsModuleComponentInfo compo { "Browser Shell Service", NS_SHELLSERVICE_CID, NS_SHELLSERVICE_CONTRACTID, - nsGNOMEShellServiceConstructor }, + nsUnixShellServiceConstructor }, #endif --- mozilla/browser/components/shell/src/Makefile.in.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/components/shell/src/Makefile.in.sav 2009-09-05 00:10:42.000000000 +0200 @@ -75,11 +75,12 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_ CPPSRCS = nsMacShellService.cpp else ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2) -CPPSRCS = nsGNOMEShellService.cpp +CPPSRCS = nsUnixShellService.cpp nsGNOMEShellService.cpp nsKDEShellService.cpp REQUIRES += \ mozgnome \ thebes \ $(NULL) +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre endif endif endif --- mozilla/browser/components/shell/src/nsKDEShellService.cpp.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/components/shell/src/nsKDEShellService.cpp.sav 2009-09-05 00:10:42.000000000 +0200 @@ -0,0 +1,193 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Shell Service. + * + * The Initial Developer of the Original Code is mozilla.org. + * Portions created by the Initial Developer are Copyright (C) 2004 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * 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 "nsKDEShellService.h" +#include "nsShellService.h" +#include "nsKDEUtils.h" +#include "nsCOMPtr.h" +#include "nsIPrefService.h" +#include "nsIProcess.h" +#include "nsILocalFile.h" +#include "nsServiceManagerUtils.h" +#include "nsComponentManagerUtils.h" + +nsresult +nsKDEShellService::Init() + { + if( !nsKDEUtils::kdeSupport()) + return NS_ERROR_NOT_AVAILABLE; + return NS_OK; + } + +NS_IMPL_ISUPPORTS1(nsKDEShellService, nsIShellService) + +NS_IMETHODIMP +nsKDEShellService::IsDefaultBrowser(PRBool aStartupCheck, + PRBool* aIsDefaultBrowser) + { + *aIsDefaultBrowser = PR_FALSE; + if (aStartupCheck) + mCheckedThisSession = PR_TRUE; + nsCStringArray command; + command.AppendCString( NS_LITERAL_CSTRING( "ISDEFAULTBROWSER" )); + if( nsKDEUtils::command( command )) + *aIsDefaultBrowser = PR_TRUE; + return NS_OK; + } + +NS_IMETHODIMP +nsKDEShellService::SetDefaultBrowser(PRBool aClaimAllTypes, + PRBool aForAllUsers) + { + nsCStringArray command; + command.AppendCString( NS_LITERAL_CSTRING( "SETDEFAULTBROWSER" )); + command.AppendCString( aClaimAllTypes ? NS_LITERAL_CSTRING( "ALLTYPES" ) : NS_LITERAL_CSTRING( "NORMAL" )); + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; + } + +NS_IMETHODIMP +nsKDEShellService::GetShouldCheckDefaultBrowser(PRBool* aResult) +{ + // If we've already checked, the browser has been started and this is a + // new window open, and we don't want to check again. + if (mCheckedThisSession) { + *aResult = PR_FALSE; + return NS_OK; + } + + nsCOMPtr prefs; + nsCOMPtr pserve(do_GetService(NS_PREFSERVICE_CONTRACTID)); + if (pserve) + pserve->GetBranch("", getter_AddRefs(prefs)); + + if (prefs) + prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult); + + return NS_OK; +} + +NS_IMETHODIMP +nsKDEShellService::SetShouldCheckDefaultBrowser(PRBool aShouldCheck) +{ + nsCOMPtr prefs; + nsCOMPtr pserve(do_GetService(NS_PREFSERVICE_CONTRACTID)); + if (pserve) + pserve->GetBranch("", getter_AddRefs(prefs)); + + if (prefs) + prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck); + + return NS_OK; +} + +NS_IMETHODIMP +nsKDEShellService::SetDesktopBackground(nsIDOMElement* aElement, + PRInt32 aPosition) + { + return NS_ERROR_NOT_IMPLEMENTED; + } + +NS_IMETHODIMP +nsKDEShellService::GetDesktopBackgroundColor(PRUint32 *aColor) + { + return NS_ERROR_NOT_IMPLEMENTED; + } + +NS_IMETHODIMP +nsKDEShellService::SetDesktopBackgroundColor(PRUint32 aColor) + { + return NS_ERROR_NOT_IMPLEMENTED; + } + +NS_IMETHODIMP +nsKDEShellService::OpenApplication(PRInt32 aApplication) + { + nsCStringArray command; + if( aApplication == APPLICATION_MAIL ) + command.AppendCString( NS_LITERAL_CSTRING( "OPENMAIL" )); + else if( aApplication == APPLICATION_NEWS ) + command.AppendCString( NS_LITERAL_CSTRING( "OPENNEWS" )); + else + return NS_ERROR_NOT_IMPLEMENTED; + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; + } + +NS_IMETHODIMP +nsKDEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI) + { + nsCStringArray command; + command.AppendCString( NS_LITERAL_CSTRING( "RUN" )); + nsCString app; + nsresult rv = aApplication->GetNativePath( app ); + NS_ENSURE_SUCCESS( rv, rv ); + command.AppendCString( app ); + command.AppendCString( aURI ); + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; + } + +NS_IMETHODIMP +nsKDEShellService::GetDefaultFeedReader(nsILocalFile** _retval) + { + *_retval = nsnull; + + nsCStringArray command; + command.AppendCString( NS_LITERAL_CSTRING( "GETDEFAULTFEEDREADER" )); + nsCStringArray output; + if( !nsKDEUtils::command( command, &output ) || output.Count() != 1 ) + return NS_ERROR_FAILURE; + + nsCString path; + path = *output[ 0 ]; + if (path.IsEmpty()) + return NS_ERROR_FAILURE; + + nsresult rv; + nsCOMPtr defaultReader = + do_CreateInstance("@mozilla.org/file/local;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = defaultReader->InitWithNativePath(path); + NS_ENSURE_SUCCESS(rv, rv); + + PRBool exists; + rv = defaultReader->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (!exists) + return NS_ERROR_FAILURE; + + NS_ADDREF(*_retval = defaultReader); + return NS_OK; + } --- mozilla/browser/components/shell/src/nsKDEShellService.h.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/components/shell/src/nsKDEShellService.h.sav 2009-09-05 00:10:42.000000000 +0200 @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Shell Service. + * + * The Initial Developer of the Original Code is mozilla.org. + * Portions created by the Initial Developer are Copyright (C) 2004 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * 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 ***** */ + +#ifndef nskdeshellservice_h____ +#define nskdeshellservice_h____ + +#include "nsIShellService.h" +#include "nsStringAPI.h" + +class nsKDEShellService : public nsIShellService +{ +public: + nsKDEShellService() : mCheckedThisSession(PR_FALSE) { } + + NS_DECL_ISUPPORTS + NS_DECL_NSISHELLSERVICE + + nsresult Init() NS_HIDDEN; + +private: + ~nsKDEShellService() {} + + PRPackedBool mCheckedThisSession; +}; + +#endif // nskdeshellservice_h____ --- mozilla/browser/components/shell/src/nsUnixShellService.cpp.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/components/shell/src/nsUnixShellService.cpp.sav 2009-09-05 00:10:42.000000000 +0200 @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Shell Service. + * + * The Initial Developer of the Original Code is mozilla.org. + * Portions created by the Initial Developer are Copyright (C) 2004 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * 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 "nsUnixShellService.h" +#include "nsGNOMEShellService.h" +#include "nsKDEShellService.h" +#include "nsKDEUtils.h" +#include "nsIGenericFactory.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init) +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsKDEShellService, Init) + +NS_METHOD +nsUnixShellServiceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult) +{ + if( nsKDEUtils::kdeSupport()) + return nsKDEShellServiceConstructor( aOuter, aIID, aResult ); + return nsGNOMEShellServiceConstructor( aOuter, aIID, aResult ); +} --- mozilla/browser/components/shell/src/nsUnixShellService.h.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/browser/components/shell/src/nsUnixShellService.h.sav 2009-09-05 00:10:42.000000000 +0200 @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Shell Service. + * + * The Initial Developer of the Original Code is mozilla.org. + * Portions created by the Initial Developer are Copyright (C) 2004 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * 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 ***** */ + +#ifndef nsunixshellservice_h____ +#define nsunixshellservice_h____ + +#include "nsIShellService.h" + +NS_METHOD +nsUnixShellServiceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult); + +#endif // nsunixshellservice_h____ --- mozilla/browser/installer/unix/packages-static.sav 2009-08-25 21:23:45.000000000 +0200 +++ mozilla/browser/installer/unix/packages-static.sav 2009-09-05 00:10:42.000000000 +0200 @@ -291,6 +291,7 @@ bin/icons/*.png bin/@PREF_DIR@/firefox.js bin/@PREF_DIR@/firefox-branding.js bin/@PREF_DIR@/channel-prefs.js +bin/@PREF_DIR@/kde.js bin/greprefs/all.js bin/greprefs/security-prefs.js bin/greprefs/xpinstall.js --- mozilla/chrome/src/Makefile.in.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/chrome/src/Makefile.in.sav 2009-09-05 00:10:42.000000000 +0200 @@ -86,6 +86,7 @@ EXTRA_DSO_LDOPTS = \ ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre endif ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) --- mozilla/chrome/src/nsChromeRegistry.cpp.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/chrome/src/nsChromeRegistry.cpp.sav 2009-09-05 00:10:42.000000000 +0200 @@ -114,6 +114,7 @@ #include "nsIXULAppInfo.h" #include "nsIXULRuntime.h" #include "nsPresShellIterator.h" +#include "nsKDEUtils.h" #ifdef MOZ_XUL // keep all the RDF stuff together, in case we can remove it in the far future @@ -2208,6 +2209,7 @@ nsChromeRegistry::ProcessManifestBuffer( NS_NAMED_LITERAL_STRING(kAppVersion, "appversion"); NS_NAMED_LITERAL_STRING(kOs, "os"); NS_NAMED_LITERAL_STRING(kOsVersion, "osversion"); + NS_NAMED_LITERAL_STRING(kDesktop, "desktop"); nsCOMPtr io (do_GetIOService()); if (!io) return NS_ERROR_FAILURE; @@ -2251,6 +2253,7 @@ nsChromeRegistry::ProcessManifestBuffer( } nsAutoString osVersion; + nsAutoString desktop; #if defined(XP_WIN) OSVERSIONINFO info = { sizeof(OSVERSIONINFO) }; if (GetVersionEx(&info)) { @@ -2258,6 +2261,7 @@ nsChromeRegistry::ProcessManifestBuffer( info.dwMajorVersion, info.dwMinorVersion); } + desktop = NS_LITERAL_STRING("win"); #elif defined(XP_MACOSX) long majorVersion, minorVersion; if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) && @@ -2266,10 +2270,12 @@ nsChromeRegistry::ProcessManifestBuffer( majorVersion, minorVersion); } + desktop = NS_LITERAL_STRING("macosx"); #elif defined(MOZ_WIDGET_GTK2) nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), gtk_major_version, gtk_minor_version); + desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome"); // TODO others? #endif char *token; @@ -2313,6 +2319,7 @@ nsChromeRegistry::ProcessManifestBuffer( TriState stApp = eUnspecified; TriState stOsVersion = eUnspecified; TriState stOs = eUnspecified; + TriState stDesktop = eUnspecified; PRBool badFlag = PR_FALSE; @@ -2326,6 +2333,7 @@ nsChromeRegistry::ProcessManifestBuffer( CheckFlag(kContentAccessible, wtoken, contentAccessible) || CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) continue; @@ -2337,7 +2345,7 @@ nsChromeRegistry::ProcessManifestBuffer( } if (badFlag || stApp == eBad || stAppVersion == eBad || - stOs == eBad || stOsVersion == eBad) + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) continue; nsCOMPtr resolved; @@ -2398,6 +2406,7 @@ nsChromeRegistry::ProcessManifestBuffer( TriState stApp = eUnspecified; TriState stOs = eUnspecified; TriState stOsVersion = eUnspecified; + TriState stDesktop = eUnspecified; PRBool badFlag = PR_FALSE; @@ -2408,6 +2417,7 @@ nsChromeRegistry::ProcessManifestBuffer( if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) continue; @@ -2419,7 +2429,7 @@ nsChromeRegistry::ProcessManifestBuffer( } if (badFlag || stApp == eBad || stAppVersion == eBad || - stOs == eBad || stOsVersion == eBad) + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) continue; nsCOMPtr resolved; @@ -2460,6 +2470,7 @@ nsChromeRegistry::ProcessManifestBuffer( TriState stApp = eUnspecified; TriState stOs = eUnspecified; TriState stOsVersion = eUnspecified; + TriState stDesktop = eUnspecified; PRBool badFlag = PR_FALSE; @@ -2470,6 +2481,7 @@ nsChromeRegistry::ProcessManifestBuffer( if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) continue; @@ -2481,7 +2493,7 @@ nsChromeRegistry::ProcessManifestBuffer( } if (badFlag || stApp == eBad || stAppVersion == eBad || - stOs == eBad || stOsVersion == eBad) + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) continue; nsCOMPtr resolved; @@ -2524,6 +2536,7 @@ nsChromeRegistry::ProcessManifestBuffer( TriState stApp = eUnspecified; TriState stOs = eUnspecified; TriState stOsVersion = eUnspecified; + TriState stDesktop = eUnspecified; PRBool badFlag = PR_FALSE; @@ -2534,6 +2547,7 @@ nsChromeRegistry::ProcessManifestBuffer( if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) continue; @@ -2545,7 +2559,7 @@ nsChromeRegistry::ProcessManifestBuffer( } if (badFlag || stApp == eBad || stAppVersion == eBad || - stOs == eBad || stOsVersion == eBad) + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) continue; nsCOMPtr baseuri, overlayuri; @@ -2580,6 +2594,7 @@ nsChromeRegistry::ProcessManifestBuffer( TriState stApp = eUnspecified; TriState stOs = eUnspecified; TriState stOsVersion = eUnspecified; + TriState stDesktop = eUnspecified; PRBool badFlag = PR_FALSE; @@ -2590,6 +2605,7 @@ nsChromeRegistry::ProcessManifestBuffer( if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) continue; @@ -2601,7 +2617,7 @@ nsChromeRegistry::ProcessManifestBuffer( } if (badFlag || stApp == eBad || stAppVersion == eBad || - stOs == eBad || stOsVersion == eBad) + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) continue; nsCOMPtr baseuri, overlayuri; @@ -2640,6 +2656,7 @@ nsChromeRegistry::ProcessManifestBuffer( TriState stApp = eUnspecified; TriState stOs = eUnspecified; TriState stOsVersion = eUnspecified; + TriState stDesktop = eUnspecified; PRBool badFlag = PR_FALSE; @@ -2650,6 +2667,7 @@ nsChromeRegistry::ProcessManifestBuffer( if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) continue; @@ -2661,7 +2679,7 @@ nsChromeRegistry::ProcessManifestBuffer( } if (badFlag || stApp == eBad || stAppVersion == eBad || - stOs == eBad || stOsVersion == eBad) + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) continue; nsCOMPtr chromeuri, resolveduri; @@ -2702,6 +2720,7 @@ nsChromeRegistry::ProcessManifestBuffer( TriState stApp = eUnspecified; TriState stOsVersion = eUnspecified; TriState stOs = eUnspecified; + TriState stDesktop = eUnspecified; PRBool badFlag = PR_FALSE; @@ -2712,6 +2731,7 @@ nsChromeRegistry::ProcessManifestBuffer( if (CheckStringFlag(kApplication, wtoken, appID, stApp) || CheckStringFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) continue; @@ -2723,7 +2743,7 @@ nsChromeRegistry::ProcessManifestBuffer( } if (badFlag || stApp == eBad || stAppVersion == eBad || - stOs == eBad || stOsVersion == eBad) + stOs == eBad || stOsVersion == eBad || stDesktop == eBad) continue; nsDependentCString host(package); --- mozilla/modules/libpref/src/Makefile.in.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/modules/libpref/src/Makefile.in.sav 2009-09-05 00:10:42.000000000 +0200 @@ -97,3 +97,5 @@ nsPrefService.$(OBJ_SUFFIX): nsPrefServi @$(MAKE_DEPS_AUTO_CXX) $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:-O2=-O1) $(_VPATH_SRCS) endif + +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre --- mozilla/modules/libpref/src/nsPrefService.cpp.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/modules/libpref/src/nsPrefService.cpp.sav 2009-09-05 00:10:42.000000000 +0200 @@ -51,6 +51,7 @@ #include "nsCOMArray.h" #include "nsXPCOMCID.h" #include "nsAutoPtr.h" +#include "nsKDEUtils.h" #include "nsQuickSort.h" #include "prmem.h" @@ -606,7 +607,8 @@ pref_LoadPrefsInDir(nsIFile* aDir, char return rv; } -static nsresult pref_LoadPrefsInDirList(const char *listId) +static nsresult pref_LoadPrefsInDirList(const char *listId, + char const *const *aSpecialFiles = NULL, PRUint32 aSpecialFilesCount = 0) { nsresult rv; nsCOMPtr dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); @@ -625,7 +627,7 @@ static nsresult pref_LoadPrefsInDirList( nsCOMPtr dir = do_QueryInterface(elem); if (dir) { // Do we care if a file provided by this process fails to load? - pref_LoadPrefsInDir(dir, nsnull, 0); + pref_LoadPrefsInDir(dir, aSpecialFiles, aSpecialFilesCount); } } } @@ -676,6 +678,7 @@ static nsresult pref_InitInitialObjects( #if defined(MOZ_WIDGET_PHOTON) , "photon.js" #endif + , "" // placeholder for KDE (empty is otherwise harmless) #elif defined(XP_OS2) "os2pref.js" #elif defined(XP_BEOS) @@ -683,12 +686,23 @@ static nsresult pref_InitInitialObjects( #endif }; + if( nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper? + for( int i = 0; + i < NS_ARRAY_LENGTH(specialFiles); + ++i ) { + if( *specialFiles[ i ] == '\0' ) { + specialFiles[ i ] = "kde.js"; + break; + } + } + } + rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles)); if (NS_FAILED(rv)) { NS_WARNING("Error parsing application default preferences."); } - rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST); + rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST, specialFiles, NS_ARRAY_LENGTH(specialFiles)); NS_ENSURE_SUCCESS(rv, rv); NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID, --- mozilla/toolkit/content/jar.mn.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/toolkit/content/jar.mn.sav 2009-09-05 00:10:42.000000000 +0200 @@ -43,6 +43,8 @@ toolkit.jar: *+ content/global/bindings/colorpicker.xml (widgets/colorpicker.xml) *+ content/global/bindings/datetimepicker.xml (widgets/datetimepicker.xml) *+ content/global/bindings/dialog.xml (widgets/dialog.xml) +*+ content/global/bindings/dialog-kde.xml (widgets/dialog-kde.xml) +% override chrome://global/content/bindings/dialog.xml chrome://global/content/bindings/dialog-kde.xml desktop=kde *+ content/global/bindings/editor.xml (widgets/editor.xml) * content/global/bindings/expander.xml (widgets/expander.xml) * content/global/bindings/filefield.xml (widgets/filefield.xml) @@ -56,6 +58,8 @@ toolkit.jar: *+ content/global/bindings/numberbox.xml (widgets/numberbox.xml) *+ content/global/bindings/popup.xml (widgets/popup.xml) *+ content/global/bindings/preferences.xml (widgets/preferences.xml) +*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml) +% 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/resizer.xml (widgets/resizer.xml) --- mozilla/toolkit/content/widgets/dialog-kde.xml.sav 2009-09-05 00:10:36.000000000 +0200 +++ mozilla/toolkit/content/widgets/dialog-kde.xml.sav 2009-09-05 00:10:42.000000000 +0200 @@ -19,7 +19,7 @@