--- a/firefox-cross-desktop.patch Sun Jan 23 11:00:33 2011 +0100
+++ b/firefox-cross-desktop.patch Wed Jan 26 16:43:00 2011 +0100
@@ -1,13 +1,15 @@
From: Wolfgang Rosenauer
-Subject: NonGnome/KDE integration
+NonGnome/KDE integration
+
References:
https://bugzilla.novell.com/show_bug.cgi?id=170055
-Caveats: desktop file name of Firefox is hardcoded to MozillaFirefox
diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
-@@ -210,13 +210,15 @@ nsContextMenu.prototype = {
+@@ -237,17 +237,19 @@ nsContextMenu.prototype = {
+ this.showItem("context-sep-viewsource", shouldShow);
+
// Set as Desktop background depends on whether an image was clicked on,
// and only works if we have a shell service.
var haveSetDesktopBackground = false;
@@ -24,46 +26,5 @@
haveSetDesktopBackground && this.onLoadedImage);
if (haveSetDesktopBackground && this.onLoadedImage) {
-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
-@@ -594,20 +594,38 @@ var gAdvancedPane = {
- var brandShortName = brandBundle.getString("brandShortName");
- var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
- var promptMessage;
- const IPS = Components.interfaces.nsIPromptService;
- var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(IPS);
-+
-+ 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;
-+
- if (!shellSvc.isDefaultBrowser(false)) {
- promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
- [brandShortName]);
- var rv = psvc.confirmEx(window, promptTitle, promptMessage,
- IPS.STD_YES_NO_BUTTONS,
- null, null, null, null, { });
-- if (rv == 0)
-+ if (rv == 0) {
- 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);
-+ }
-+ }
- }
- else {
- promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
- [brandShortName]);
- psvc.alert(window, promptTitle, promptMessage);
- }
+ document.getElementById("context-setDesktopBackground")
+ .disabled = this.disableSetDesktopBackground();