Index: lib/filterStorage.js |
=================================================================== |
--- a/lib/filterStorage.js |
+++ b/lib/filterStorage.js |
@@ -82,16 +82,22 @@ let FilterStorage = exports.FilterStorag |
if (!file) |
Cu.reportError("Adblock Plus: Failed to resolve filter file location from extensions.adblockplus.patternsfile preference"); |
this.__defineGetter__("sourceFile", function() file); |
return this.sourceFile; |
}, |
/** |
+ * Will be set to true if no patterns.ini file exists. |
+ * @type Boolean |
+ */ |
+ firstRun: false, |
+ |
+ /** |
* Map of properties listed in the filter storage file before the sections |
* start. Right now this should be only the format version. |
*/ |
fileProperties: {__proto__: null}, |
/** |
* List of filter subscriptions containing all filters |
* @type Array of Subscription |
@@ -461,18 +467,21 @@ let FilterStorage = exports.FilterStorag |
{ |
explicitFile = false; |
sourceFile = FilterStorage.sourceFile; |
let callback = function(e, statData) |
{ |
if (e || !statData.exists) |
{ |
- let {addonRoot} = require("info"); |
- sourceFile = Services.io.newURI(addonRoot + "defaults/patterns.ini", null, null); |
+ this.firstRun = true; |
+ this._loading = false; |
+ FilterNotifier.triggerListeners("load"); |
+ |
+ TimeLine.leave("FilterStorage.loadFromDisk() read callback done"); |
} |
startRead(sourceFile); |
} |
if (sourceFile) |
IO.statFile(sourceFile, callback); |
else |
callback(true); |