Skip to content

Commit

Permalink
Refactoring usages of Preferences.save into Preferences.setAndSave in…
Browse files Browse the repository at this point in the history
… Selenium IDE
  • Loading branch information
samitbadle committed Aug 17, 2013
1 parent 8c52d7d commit df5c367
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions ide/main/src/content/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ function Application() {
Application.prototype = {
saveState: function() {
if (this.options.rememberBaseURL == 'true'){
this.options.baseURL = this.baseURL;
Preferences.save(this.options, 'baseURL');
Preferences.setAndSave(this.options, 'baseURL', this.baseURL);
}
},

Expand Down Expand Up @@ -113,8 +112,7 @@ Application.prototype = {
//sync the testcase with the data view
this.notify("currentFormatChanging");
this.currentFormat = format;
this.options.selectedFormat = format.id;
Preferences.save(this.options, 'selectedFormat');
Preferences.setAndSave(this.options, 'selectedFormat', format.id);
this.notify("currentFormatChanged", format);
},

Expand All @@ -128,8 +126,7 @@ Application.prototype = {

setClipboardFormat: function(format) {
this.clipboardFormat = format;
this.options.clipboardFormat = format.id;
Preferences.save(this.options, 'clipboardFormat');
Preferences.setAndSave(this.options, 'clipboardFormat', format.id);
this.notify("clipboardFormatChanged", format);
},

Expand Down
9 changes: 3 additions & 6 deletions ide/main/src/content/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ function Editor(window) {
self.updateState();
self.alreadySaved = false;
self.app.currentFormat = format;
self.app.options.selectedFormat = format.id;
Preferences.save(self.app.options, 'selectedFormat');
Preferences.setAndSave(self.app.options, 'selectedFormat', format.id);
}
}
},
Expand All @@ -141,8 +140,7 @@ function Editor(window) {

LocatorBuilders.addObserver({
preferredOrderChanged: function (preferredOrder) {
self.app.options.locatorBuildersOrder = preferredOrder.join(',');
Preferences.save(self.app.options, 'locatorBuildersOrder');
Preferences.setAndSave(self.app.options, 'locatorBuildersOrder', preferredOrder.join(','));
}
});

Expand Down Expand Up @@ -213,8 +211,7 @@ function Editor(window) {
var versionString = Editor.getString('selenium-ide.version');
if (!this.app.options.currentVersion || this.app.options.currentVersion != versionString) {
openTabOrWindow('http://code.google.com/p/selenium/wiki/SeIDEReleaseNotes');
this.app.options.currentVersion = versionString;
Preferences.save(this.app.options, 'currentVersion');
Preferences.setAndSave(this.app.options, 'currentVersion', versionString);
}
}

Expand Down

0 comments on commit df5c367

Please sign in to comment.