diff --git a/browser/base/content/browser-kde.xul b/browser/base/content/browser-kde.xul
new file mode 100644
--- /dev/null
+++ b/browser/base/content/browser-kde.xul
@@ -0,0 +1,1126 @@
+#filter substitution
+
+# -*- Mode: HTML -*-
+#
+# 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
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+
+
+
+
+
+
+
+
+
+# All DTD information is stored in a separate file so that it can be shared by
+# hiddenWindow.xul.
+#include browser-doctype.inc
+
+
+
+# All JS files which are not content (only) dependent that browser.xul
+# wishes to include *must* go into the global-scripts.inc file
+# so that they can be shared by macBrowserOverlay.xul.
+#include global-scripts.inc
+
+
+#ifdef MOZ_SAFE_BROWSING
+
+#endif
+
+
+
+
+# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the
+# browser-sets.inc file for sharing with hiddenWindow.xul.
+#define FULL_BROWSER_WINDOW
+#include browser-sets.inc
+#undef FULL_BROWSER_WINDOW
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifdef XP_UNIX
+
+
+#else
+
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#include browser-context.inc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifdef XP_MACOSX
+
+#else
+
+#endif
+
+
+
+
+#ifdef XP_MACOSX
+
+#else
+
+#endif
+
+
+
+#ifdef CAN_DRAW_IN_TITLEBAR
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif
+
+
+
+
+
+
+
+
+# The entire main menubar is placed into browser-menubar.inc, so that it can be shared by
+# hiddenWindow.xul.
+#include browser-menubar.inc
+
+
+#ifdef CAN_DRAW_IN_TITLEBAR
+
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifdef MENUBAR_CAN_AUTOHIDE
+#ifndef CAN_DRAW_IN_TITLEBAR
+#define APPMENU_ON_TABBAR
+#endif
+#endif
+
+
+
+
+#ifdef APPMENU_ON_TABBAR
+
+#include browser-appmenu.inc
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifdef CAN_DRAW_IN_TITLEBAR
+
+
+#endif
+
+
+
+
+# Update primaryToolbarButtons in browser/themes/browserShared.inc when adding
+# or removing default items with the toolbarbutton-1 class.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifdef MOZ_SERVICES_SYNC
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifdef XP_MACOSX
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifndef XP_MACOSX
+
+#endif
+
+
+
+#ifdef XP_MACOSX
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+#ifndef XP_MACOSX
+
+#endif
+
+
+
+
+
+
+
+
+#ifndef XP_UNIX
+
+
+
+
+
+
+
+
+#endif
+#ifdef XP_MACOSX
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif
+
+
+#
+
+
diff --git a/browser/base/jar.mn b/browser/base/jar.mn
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -35,16 +35,18 @@ browser.jar:
content/browser/abouthome/restore-large.png (content/abouthome/restore-large.png)
content/browser/abouthome/mozilla.png (content/abouthome/mozilla.png)
content/browser/abouthome/noise.png (content/abouthome/noise.png)
content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)
content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png)
* content/browser/browser.css (content/browser.css)
* content/browser/browser.js (content/browser.js)
* content/browser/browser.xul (content/browser.xul)
+* content/browser/browser-kde.xul (content/browser-kde.xul)
+% override chrome://browser/content/browser.xul chrome://browser/content/browser-kde.xul desktop=kde
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
* content/browser/content.js (content/content.js)
* content/browser/newtab/newTab.xul (content/newtab/newTab.xul)
* content/browser/newtab/newTab.js (content/newtab/newTab.js)
content/browser/newtab/newTab.css (content/newtab/newTab.css)
* content/browser/pageinfo/pageInfo.xul (content/pageinfo/pageInfo.xul)
* content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js)
* content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css)
diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/nsModule.cpp
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -8,17 +8,17 @@
#include "nsBrowserCompsCID.h"
#include "DirectoryProvider.h"
#if defined(XP_WIN)
#include "nsWindowsShellService.h"
#elif defined(XP_MACOSX)
#include "nsMacShellService.h"
#elif defined(MOZ_WIDGET_GTK2)
-#include "nsGNOMEShellService.h"
+#include "nsUnixShellService.h"
#endif
#if defined(XP_WIN) && !defined(__MINGW32__)
#include "nsIEHistoryEnumerator.h"
#endif
#include "rdf.h"
#include "nsFeedSniffer.h"
@@ -32,18 +32,16 @@ using namespace mozilla::browser;
/////////////////////////////////////////////////////////////////////////////
NS_GENERIC_FACTORY_CONSTRUCTOR(DirectoryProvider)
#if defined(XP_WIN)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
#elif defined(XP_MACOSX)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
-#elif defined(MOZ_WIDGET_GTK2)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
#endif
#if defined(XP_WIN) && !defined(__MINGW32__)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
@@ -64,17 +62,17 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID)
#endif
NS_DEFINE_NAMED_CID(NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID);
static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
{ &kNS_BROWSERDIRECTORYPROVIDER_CID, false, NULL, DirectoryProviderConstructor },
#if defined(XP_WIN)
{ &kNS_SHELLSERVICE_CID, false, NULL, nsWindowsShellServiceConstructor },
#elif defined(MOZ_WIDGET_GTK2)
- { &kNS_SHELLSERVICE_CID, false, NULL, nsGNOMEShellServiceConstructor },
+ { &kNS_SHELLSERVICE_CID, false, NULL, nsUnixShellServiceConstructor },
#endif
{ &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
{ &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
#if defined(XP_WIN) && !defined(__MINGW32__)
{ &kNS_WINIEHISTORYENUMERATOR_CID, false, NULL, nsIEHistoryEnumeratorConstructor },
#elif defined(XP_MACOSX)
{ &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
#endif
diff --git a/browser/components/preferences/advanced.js b/browser/components/preferences/advanced.js
--- a/browser/components/preferences/advanced.js
+++ b/browser/components/preferences/advanced.js
@@ -23,16 +23,22 @@ var gAdvancedPane = {
if (extraArgs && extraArgs["advancedTab"]){
advancedPrefs.selectedTab = document.getElementById(extraArgs["advancedTab"]);
} else {
var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
if (preference.value !== null)
advancedPrefs.selectedIndex = preference.value;
}
+ var env = Components.classes["@mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+ var kde_session = 0;
+ if (env.get('KDE_FULL_SESSION') == "true")
+ kde_session = 1;
+
#ifdef HAVE_SHELL_SERVICE
this.updateSetDefaultBrowser();
#endif
#ifdef MOZ_UPDATER
this.updateReadPrefs();
#endif
this.updateOfflineApps();
#ifdef MOZ_CRASHREPORTER
@@ -715,12 +721,23 @@ var gAdvancedPane = {
* Set browser as the operating system default browser.
*/
setDefaultBrowser: function()
{
let shellSvc = getShellService();
if (!shellSvc)
return;
shellSvc.setDefaultBrowser(true, false);
+ if (kde_session == 1) {
+ var shellObj = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ shellObj.initWithPath("/usr/bin/kwriteconfig");
+ var process = Components.classes["@mozilla.org/process/util;1"]
+ .createInstance(Components.interfaces.nsIProcess);
+ process.init(shellObj);
+ var args = ["--file", "kdeglobals", "--group", "General", "--key",
+ "BrowserApplication", "MozillaFirefox"];
+ process.run(false, args, args.length);
+ }
document.getElementById("setDefaultPane").selectedIndex = 1;
}
#endif
};
diff --git a/browser/components/shell/src/Makefile.in b/browser/components/shell/src/Makefile.in
--- a/browser/components/shell/src/Makefile.in
+++ b/browser/components/shell/src/Makefile.in
@@ -17,17 +17,18 @@ USE_STATIC_LIBS = 1
ifeq ($(OS_ARCH),WINNT)
CPPSRCS = nsWindowsShellService.cpp
else
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS = nsMacShellService.cpp
else
ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2)
-CPPSRCS = nsGNOMEShellService.cpp
+CPPSRCS = nsUnixShellService.cpp nsGNOMEShellService.cpp nsKDEShellService.cpp
+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
endif
endif
endif
ifdef CPPSRCS
LIBRARY_NAME = shellservice_s
endif
diff --git a/browser/components/shell/src/nsKDEShellService.cpp b/browser/components/shell/src/nsKDEShellService.cpp
new file mode 100644
--- /dev/null
+++ b/browser/components/shell/src/nsKDEShellService.cpp
@@ -0,0 +1,264 @@
+/* -*- 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"
+#include "nsIMutableArray.h"
+#include "nsISupportsPrimitives.h"
+#include "nsArrayUtils.h"
+
+nsresult
+nsKDEShellService::Init()
+ {
+ if( !nsKDEUtils::kdeSupport())
+ return NS_ERROR_NOT_AVAILABLE;
+ return NS_OK;
+ }
+
+NS_IMPL_ISUPPORTS1(nsKDEShellService, nsIShellService)
+
+NS_IMETHODIMP
+nsKDEShellService::IsDefaultBrowser(bool aStartupCheck,
+ bool* aIsDefaultBrowser)
+ {
+ *aIsDefaultBrowser = false;
+ if (aStartupCheck)
+ mCheckedThisSession = true;
+
+ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ if (!command)
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ if (!str)
+ return NS_ERROR_FAILURE;
+
+ str->SetData( NS_LITERAL_CSTRING( "ISDEFAULTBROWSER" ));
+ command->AppendElement( str, false );
+
+ if( nsKDEUtils::command( command ))
+ *aIsDefaultBrowser = true;
+ return NS_OK;
+ }
+
+NS_IMETHODIMP
+nsKDEShellService::SetDefaultBrowser(bool aClaimAllTypes,
+ bool aForAllUsers)
+ {
+ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ if (!command)
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr cmdstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ nsCOMPtr paramstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ if (!cmdstr || !paramstr)
+ return NS_ERROR_FAILURE;
+
+ cmdstr->SetData( NS_LITERAL_CSTRING( "SETDEFAULTBROWSER" ));
+ command->AppendElement( cmdstr, false );
+
+ paramstr->SetData( aClaimAllTypes ? NS_LITERAL_CSTRING( "ALLTYPES" ) : NS_LITERAL_CSTRING( "NORMAL" ));
+ command->AppendElement( paramstr, false );
+
+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
+ }
+
+NS_IMETHODIMP
+nsKDEShellService::GetShouldCheckDefaultBrowser(bool* 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 = 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(bool 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::GetCanSetDesktopBackground(bool* aResult)
+{
+ *aResult = true;
+ 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)
+ {
+ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ if (!command)
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ if (!str)
+ return NS_ERROR_FAILURE;
+
+ if( aApplication == APPLICATION_MAIL )
+ str->SetData( NS_LITERAL_CSTRING( "OPENMAIL" ));
+ else if( aApplication == APPLICATION_NEWS )
+ str->SetData( NS_LITERAL_CSTRING( "OPENNEWS" ));
+ else
+ return NS_ERROR_NOT_IMPLEMENTED;
+
+ command->AppendElement( str, false );
+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
+ }
+
+NS_IMETHODIMP
+nsKDEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
+ {
+ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ if (!command)
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr cmdstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ nsCOMPtr appstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ nsCOMPtr uristr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ if (!cmdstr || !appstr || !uristr)
+ return NS_ERROR_FAILURE;
+
+ cmdstr->SetData( NS_LITERAL_CSTRING( "RUN" ));
+ command->AppendElement( cmdstr, false );
+ nsCAutoString app;
+ nsresult rv = aApplication->GetNativePath( app );
+ NS_ENSURE_SUCCESS( rv, rv );
+ appstr->SetData( app );
+ command->AppendElement( appstr, false );
+ uristr->SetData( aURI );
+ command->AppendElement( uristr, false );
+ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
+ }
+
+NS_IMETHODIMP
+nsKDEShellService::GetDefaultFeedReader(nsILocalFile** _retval)
+ {
+ *_retval = nsnull;
+
+ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ if( !command )
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ if( !str )
+ return NS_ERROR_FAILURE;
+
+ str->SetData( NS_LITERAL_CSTRING( "GETDEFAULTFEEDREADER" ));
+ command->AppendElement( str, false );
+
+ nsCOMPtr output;
+ if( !nsKDEUtils::command( command, getter_AddRefs( output ) ) )
+ return NS_ERROR_FAILURE;
+
+ PRUint32 length;
+ output->GetLength( &length );
+ if( length != 1 )
+ return NS_ERROR_FAILURE;
+
+ nsCOMPtr resstr = do_QueryElementAt( output, 0 );
+ if( !resstr )
+ return NS_ERROR_FAILURE;
+
+ nsCAutoString path;
+ resstr->GetData( path );
+ 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);
+
+ bool exists;
+ rv = defaultReader->Exists(&exists);
+ NS_ENSURE_SUCCESS(rv, rv);
+ if (!exists)
+ return NS_ERROR_FAILURE;
+
+ NS_ADDREF(*_retval = defaultReader);
+ return NS_OK;
+ }
diff --git a/browser/components/shell/src/nsKDEShellService.h b/browser/components/shell/src/nsKDEShellService.h
new file mode 100644
--- /dev/null
+++ b/browser/components/shell/src/nsKDEShellService.h
@@ -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____
diff --git a/browser/components/shell/src/nsUnixShellService.cpp b/browser/components/shell/src/nsUnixShellService.cpp
new file mode 100644
--- /dev/null
+++ b/browser/components/shell/src/nsUnixShellService.cpp
@@ -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 "mozilla/ModuleUtils.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 );
+}
diff --git a/browser/components/shell/src/nsUnixShellService.h b/browser/components/shell/src/nsUnixShellService.h
new file mode 100644
--- /dev/null
+++ b/browser/components/shell/src/nsUnixShellService.h
@@ -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____
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -520,18 +520,20 @@
@BINPATH@/@PREF_DIR@/services-aitc.js
#endif
@BINPATH@/greprefs.js
@BINPATH@/defaults/autoconfig/platform.js
@BINPATH@/defaults/autoconfig/prefcalls.js
#ifndef LIBXUL_SDK
; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
@BINPATH@/defaults/pref/channel-prefs.js
+@BINPATH@/defaults/pref/kde.js
#else
@BINPATH@/@PREF_DIR@/channel-prefs.js
+@BINPATH@/@PREF_DIR@/kde.js
#endif
@BINPATH@/defaults/profile/prefs.js
; [Layout Engine Resources]
; Style Sheets, Graphics and other Resources used by the layout engine.
@BINPATH@/res/EditorOverride.css
@BINPATH@/res/contenteditable.css
@BINPATH@/res/designmode.css