Use Services.io getter

This commit is contained in:
Sylvester Keil 2018-08-02 13:11:15 +02:00
parent 7f2d83a602
commit 95559a0c62
No known key found for this signature in database
GPG key ID: 878933BCEAB25A10

View file

@ -29,16 +29,12 @@ Zotero.LocateManager = new function() {
var _jsonFile;
var _locateEngines;
var _ios;
var _timer;
/**
* Read locateEngines JSON file to initialize locate manager
*/
this.init = async function() {
_ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
_jsonFile = _getLocateFile();
try {
@ -271,7 +267,7 @@ Zotero.LocateManager = new function() {
* Theoretically implements nsISearchSubmission
*/
var LocateSubmission = function(uri, postData) {
this.uri = _ios.newURI(uri, null, null);
this.uri = Services.io.newURI(uri, null, null);
this.postData = postData;
}
@ -447,7 +443,7 @@ Zotero.LocateManager = new function() {
"_removeIcon":function() {
if(!this.icon) return;
var uri = _ios.newURI(this.icon, null, null);
var uri = Services.io.newURI(this.icon, null, null);
var file = uri.QueryInterface(Components.interfaces.nsIFileURL).file;
if(file.exists()) file.remove(null);
},
@ -492,4 +488,4 @@ Zotero.LocateManager = new function() {
this.icon = OS.Path.toFileURI(iconFile);
}
}
}
}