Skip to content

Commit

Permalink
issue6133: "Reset all options" should reset the default include() ali…
Browse files Browse the repository at this point in the history
…ases
  • Loading branch information
fflorent committed Apr 30, 2013
1 parent 70a51cf commit 13f521b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
15 changes: 9 additions & 6 deletions extension/content/firebug/console/commandLineInclude.js
Expand Up @@ -42,8 +42,9 @@ catch(ex)
// Scratchpad does not exists (when using Seamonkey ...)
}

var storageScope = {};
var storageScope = {}, StorageService;
Cu.import("resource://firebug/storageService.js", storageScope);
StorageService = storageScope.StorageService;

This comment has been minimized.

Copy link
@janodvarko

janodvarko May 6, 2013

Member

Not big deal, but I would prefer:

var storageScope = {};
Cu.import("resource://firebug/storageService.js", storageScope);
var StorageService = storageScope.StorageService;

Honza


var defaultAliases = {
"jquery": "http://code.jquery.com/jquery-latest.js"
Expand Down Expand Up @@ -345,11 +346,11 @@ var CommandLineInclude = Obj.extend(Firebug.Module,
{
if (!this.store)
{
var isNewStore = !storageScope.StorageService.hasStorage(storeFilename);
var isNewStore = !StorageService.hasStorage(storeFilename);
// Pass also the parent window to the new storage. The window will be
// used to figure out whether the browser is running in private mode.
// If yes, no data will be persisted.
this.store = storageScope.StorageService.getStorage(storeFilename,
this.store = StorageService.getStorage(storeFilename,
Firebug.chrome.window);

// If the file did not exist, we put in there the default aliases.
Expand Down Expand Up @@ -512,9 +513,11 @@ var CommandLineInclude = Obj.extend(Firebug.Module,

resetAllOptions: function()
{
var store = this.getStore();
if (store)
store.clear(true);
if (StorageService.hasStorage(storeFilename))
{
StorageService.removeStorage(storeFilename);
this.store = null;
}
}
});

Expand Down
8 changes: 7 additions & 1 deletion extension/modules/storageService.js
Expand Up @@ -158,7 +158,7 @@ var StorageService =

removeStorage: function(leafName)
{
ObjectPersister.deleteObject(leafname);
ObjectPersister.deleteObject(leafName);
},

hasStorage: function(leafName)
Expand Down Expand Up @@ -324,6 +324,12 @@ var ObjectPersister =
}
},

deleteObject: function(leafName)
{
var file = this.getFile(leafName);
return file.remove(false);
},

// xxxHonza: this entire method is duplicated from firebug/lib/privacy module
// As soon as this JSM is AMD we should just use firebug/lib/privacy.
isPrivateBrowsing: function(win)
Expand Down

0 comments on commit 13f521b

Please sign in to comment.