Skip to content

Commit

Permalink
Replace nsILocalFile with nsIFile.
Browse files Browse the repository at this point in the history
Fixes #1642
  • Loading branch information
arantius committed Sep 27, 2012
1 parent f530dbf commit 93aee80
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/greasemonkey.js
Expand Up @@ -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 //////////////////////

Expand Down
2 changes: 1 addition & 1 deletion content/third-party/mpl-utils.js
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions modules/remoteScript.js
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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.');
Expand Down
2 changes: 1 addition & 1 deletion modules/scriptDependency.js
Expand Up @@ -22,7 +22,7 @@ ScriptDependency.prototype = {
},

setFilename: function(aFile) {
aFile.QueryInterface(Components.interfaces.nsILocalFile);
aFile.QueryInterface(Components.interfaces.nsIFile);
this._filename = aFile.leafName;
},

Expand Down
2 changes: 1 addition & 1 deletion modules/util/getEditor.js
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions modules/util/getTempDir.js
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions modules/util/getTempFile.js
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion modules/util/openInEditor.js
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion modules/util/scriptDir.js
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion modules/util/writeToFile.js
Expand Up @@ -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;

Expand Down

0 comments on commit 93aee80

Please sign in to comment.