Skip to content
Browse files

Replace nsILocalFile with nsIFile.

Fixes #1642
  • Loading branch information...
1 parent f530dbf commit 93aee8074ad122484665f0e2a747640f194987dd @arantius arantius committed Sep 27, 2012
View
2 components/greasemonkey.js
@@ -62,7 +62,7 @@ var gStringBundle = Components
.createBundle("chrome://greasemonkey/locale/greasemonkey.properties");
var gTmpDir = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
- .get("TmpD", Components.interfaces.nsILocalFile);
+ .get("TmpD", Components.interfaces.nsIFile);
/////////////////////// Component-global Helper Functions //////////////////////
View
2 content/third-party/mpl-utils.js
@@ -34,7 +34,7 @@ Contributor(s):
function GM_openFolder(aFile) {
try {
// Show the directory containing the file and select the file.
- aFile.QueryInterface(Components.interfaces.nsILocalFile).reveal();
+ aFile.QueryInterface(Components.interfaces.nsIFile).reveal();
} catch (e) {
// Either the file doesn't exist or reveal is not implemented
var fParent = aFile.parent;
View
6 modules/remoteScript.js
@@ -303,7 +303,7 @@ RemoteScript.prototype.install = function(aOldScript, aOnlyDependencies) {
// Just move the dependencies in.
var enumerator = this._tempDir.directoryEntries;
while (enumerator.hasMoreElements()) {
- var file = enumerator.getNext().QueryInterface(Ci.nsILocalFile);
+ var file = enumerator.getNext().QueryInterface(Ci.nsIFile);
// TODO: Fix invalid private access.
file.moveTo(this.script._basedirFile, null);
}
@@ -482,11 +482,11 @@ RemoteScript.prototype._downloadDependencies = function(aCompletionCallback) {
uri, file, GM_util.hitch(this, dependencyDownloadComplete));
};
-/** Download a given nsIURI to a given nsILocalFile, with optional callback. */
+/** Download a given nsIURI to a given nsIFile, with optional callback. */
RemoteScript.prototype._downloadFile = function(
aUri, aFile, aCompletionCallback) {
aUri = aUri.QueryInterface(Ci.nsIURI);
- aFile = aFile.QueryInterface(Ci.nsILocalFile);
+ aFile = aFile.QueryInterface(Ci.nsIFile);
aCompletionCallback = aCompletionCallback || function() {};
assertIsFunction(aCompletionCallback,
'_downloadFile() completion callback is not a function.');
View
2 modules/scriptDependency.js
@@ -22,7 +22,7 @@ ScriptDependency.prototype = {
},
setFilename: function(aFile) {
- aFile.QueryInterface(Components.interfaces.nsILocalFile);
+ aFile.QueryInterface(Components.interfaces.nsIFile);
this._filename = aFile.leafName;
},
View
2 modules/util/getEditor.js
@@ -15,7 +15,7 @@ function getEditor(change) {
var editor;
try {
editor = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
+ .createInstance(Components.interfaces.nsIFile);
editor.followLinks = true;
editor.initWithPath(editorPath);
} catch (e) {
View
4 modules/util/getTempDir.js
@@ -2,10 +2,10 @@ Components.utils.import('resource://greasemonkey/constants.js');
const EXPORTED_SYMBOLS = ['getTempDir'];
-const DIRECTORY_TYPE = Components.interfaces.nsILocalFile.DIRECTORY_TYPE;
+const DIRECTORY_TYPE = Components.interfaces.nsIFile.DIRECTORY_TYPE;
const TMP_DIR = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
- .get("TmpD", Components.interfaces.nsILocalFile);
+ .get("TmpD", Components.interfaces.nsIFile);
function getTempDir(aRoot) {
var file = (aRoot || TMP_DIR).clone();
View
4 modules/util/getTempFile.js
@@ -2,10 +2,10 @@ Components.utils.import('resource://greasemonkey/constants.js');
const EXPORTED_SYMBOLS = ['getTempFile'];
-const NORMAL_FILE_TYPE = Components.interfaces.nsILocalFile.NORMAL_FILE_TYPE;
+const NORMAL_FILE_TYPE = Components.interfaces.nsIFile.NORMAL_FILE_TYPE;
const TMP_DIR = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
- .get("TmpD", Components.interfaces.nsILocalFile);
+ .get("TmpD", Components.interfaces.nsIFile);
function getTempFile(aRoot, aLeaf) {
var file = (aRoot || TMP_DIR).clone();
View
2 modules/util/openInEditor.js
@@ -27,7 +27,7 @@ function openInEditor(script) {
if ("Darwin"==xulRuntime.OS) {
args = ["-a", editor.path, script.file.path];
editor = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
+ .createInstance(Components.interfaces.nsIFile);
editor.followLinks = true;
editor.initWithPath("/usr/bin/open");
}
View
2 modules/util/scriptDir.js
@@ -5,7 +5,7 @@ const EXPORTED_SYMBOLS = ['scriptDir'];
const SCRIPT_DIR = Components
.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
- .get("ProfD", Components.interfaces.nsILocalFile);
+ .get("ProfD", Components.interfaces.nsIFile);
SCRIPT_DIR.append("gm_scripts");
function scriptDir() {
View
2 modules/util/writeToFile.js
@@ -3,7 +3,7 @@ Components.utils.import('resource://greasemonkey/constants.js');
const EXPORTED_SYMBOLS = ['writeToFile'];
-const NORMAL_FILE_TYPE = Components.interfaces.nsILocalFile.NORMAL_FILE_TYPE;
+const NORMAL_FILE_TYPE = Components.interfaces.nsIFile.NORMAL_FILE_TYPE;
// PR_WRONLY PR_CREATE_FILE PR_TRUNCATE
const STREAM_FLAGS = 0x02 | 0x08 | 0x20;

0 comments on commit 93aee80

Please sign in to comment.
Something went wrong with that request. Please try again.