mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
73 lines
2.8 KiB
Diff
73 lines
2.8 KiB
Diff
app/content/scripts/appInit.js | 12 ++++++++++--
|
|
1 files changed, 10 insertions(+), 2 deletions(-)
|
|
|
|
diff --git app/content/scripts/appInit.js app/content/scripts/appInit.js
|
|
index 516c815..c982363 100644
|
|
--- app/content/scripts/appInit.js
|
|
+++ app/content/scripts/appInit.js
|
|
@@ -155,26 +155,30 @@ function SBAppInitialize()
|
|
// On Windows and Linux, register the songbird:// protocol.
|
|
// (Mac is in the info.plist)
|
|
var platform = Components.classes["@mozilla.org/system-info;1"]
|
|
.getService(Components.interfaces.nsIPropertyBag2)
|
|
.getProperty("name");
|
|
if (platform == "Windows_NT") {
|
|
SBRegisterWindowsSongbirdProtocol();
|
|
}
|
|
- else if (platform == "Linux") {
|
|
+ else {
|
|
SBRegisterGConfSongbirdProtocol();
|
|
}
|
|
}
|
|
catch( err ) {
|
|
alert( "SBAppInitialize:SBRegisterSongbirdProtocol()\n" + err );
|
|
}
|
|
}
|
|
|
|
function SBRegisterWindowsSongbirdProtocol() {
|
|
+ if (!("@mozilla.org/windows-registry-key;1" in Components.classes)) {
|
|
+ // no windows registry key, probably not Windows
|
|
+ return;
|
|
+ }
|
|
var path = Components.classes["@mozilla.org/file/directory_service;1"]
|
|
.getService(Components.interfaces.nsIProperties)
|
|
.get("CurProcD", Components.interfaces.nsIFile);
|
|
var file = path.clone();
|
|
// It'd be nice if there were a way to look this up.
|
|
// (mook suggests) ::GetModuleFileNameW().
|
|
// http://mxr.mozilla.org/seamonkey/source/browser/components/shell/src/nsWindowsShellService.cpp#264
|
|
file.append("songbird.exe");
|
|
@@ -199,24 +203,28 @@ function SBRegisterWindowsSongbirdProtocol() {
|
|
wrk.create(wrk.ROOT_KEY_CURRENT_USER,
|
|
"Software\\Classes\\songbird\\shell\\open\\command",
|
|
wrk.ACCESS_WRITE);
|
|
wrk.writeStringValue("", '"' + file.path + '" "%1"');
|
|
wrk.close();
|
|
}
|
|
|
|
function SBRegisterGConfSongbirdProtocol() {
|
|
+ if (!("@mozilla.org/gnome-gconf-service;1" in Components.classes)) {
|
|
+ // gnome-gconf-service doesn't exist
|
|
+ return;
|
|
+ }
|
|
var path = Components.classes["@mozilla.org/file/directory_service;1"]
|
|
.getService(Components.interfaces.nsIProperties)
|
|
.get("CurProcD", Components.interfaces.nsIFile);
|
|
var file = path.clone();
|
|
file.append("songbird");
|
|
|
|
var gconf = Components.classes["@mozilla.org/gnome-gconf-service;1"]
|
|
- .getService(Components.interfaces.nsIGConfService);
|
|
+ .getService(Components.interfaces.nsIGConfService);
|
|
gconf.setString("/desktop/gnome/url-handlers/songbird/command", '"' + file.path + '" "%s"');
|
|
gconf.setBool("/desktop/gnome/url-handlers/songbird/enabled", true);
|
|
gconf.setBool("/desktop/gnome/url-handlers/songbird/needs_terminal", false);
|
|
}
|
|
|
|
//
|
|
// Called on window-unload of songbird.xul.
|
|
//
|
|
--
|
|
1.5.5.1015.g9d258
|
|
|
|
|