From c4c5a3425b9d2387ce4756d3f0984918f1a0d6f2 Mon Sep 17 00:00:00 2001 From: foudfou Date: Fri, 19 Apr 2013 21:57:43 +0200 Subject: [PATCH] address compatibility warnings from AMO https://addons.mozilla.org/en-US/developers/addon/firetray/file/203468/validation. Not sure if we should not just drop compatibility... We should be able to support back to Gecko 4.0 but ctypes-utils.jsm uses features introduced in 7.0. --- src/install.rdf | 6 +++--- src/modules/FiretrayMessaging.jsm | 4 +++- src/modules/PrefListener.jsm | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/install.rdf b/src/install.rdf index 4a6aa4f..a409c40 100644 --- a/src/install.rdf +++ b/src/install.rdf @@ -18,7 +18,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - 13.0 + 7.0 23.0 @@ -26,7 +26,7 @@ {3550f703-e582-4d05-9a08-453d09bdfdc6} - 15.0 + 7.0 23.0 @@ -34,7 +34,7 @@ {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} - 2.1 + 2.4 2.20 diff --git a/src/modules/FiretrayMessaging.jsm b/src/modules/FiretrayMessaging.jsm index 964fc83..05780f8 100644 --- a/src/modules/FiretrayMessaging.jsm +++ b/src/modules/FiretrayMessaging.jsm @@ -325,7 +325,9 @@ firetray.Messaging = { log.debug("runProcess="+filepath+" args="+args); try { // create a file for the process - var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); // TODO: nsILocalFile merged into the nsIFile in Gecko 14 + var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); + if (!file.initWithPath) + file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); // deprecated in Gecko 14 file.initWithPath(filepath); // create the process diff --git a/src/modules/PrefListener.jsm b/src/modules/PrefListener.jsm index 93b0931..b688a91 100644 --- a/src/modules/PrefListener.jsm +++ b/src/modules/PrefListener.jsm @@ -21,7 +21,9 @@ function PrefListener(branch_name, callback) { var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); this._branch = prefService.getBranch(branch_name); - this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2); // FIXME: deprecated in Gecko 13.0 + this._branch.QueryInterface(Ci.nsIPrefBranch); + if (!this._branch.addObserver) + this._branch.QueryInterface(Ci.nsIPrefBranch2); // deprecated in Gecko 13.0 this._callback = callback; }