Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Remove old preference system
Browse files Browse the repository at this point in the history
  • Loading branch information
sprintr committed Aug 26, 2016
1 parent a0a0a54 commit d6ae906
Show file tree
Hide file tree
Showing 15 changed files with 3 additions and 784 deletions.
5 changes: 0 additions & 5 deletions src/LiveDevelopment/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,6 @@ define(function main(require, exports, module) {
_updateHighlightCheckmark();
});

PreferencesManager.convertPreferences(module, {
"highlight": "user livedev.highlight",
"afterFirstLaunch": "user livedev.afterFirstLaunch"
}, true);

config.highlight = PreferencesManager.getViewState("livedev.highlight");

// init commands
Expand Down
25 changes: 0 additions & 25 deletions src/document/DocumentManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,28 +612,6 @@ define(function (require, exports, module) {
exports.trigger("documentSaved", doc);
});

/**
* @private
* Examine each preference key for migration of the working set files.
* If the key has a prefix of "files_/", then it is a working set files
* preference from old preference model.
*
* @param {string} key The key of the preference to be examined
* for migration of working set files.
* @return {?string} - the scope to which the preference is to be migrated
*/
function _checkPreferencePrefix(key) {
var pathPrefix = "files_";
if (key.indexOf(pathPrefix) === 0) {
// Get the project path from the old preference key by stripping "files_".
var projectPath = key.substr(pathPrefix.length);
return "user project.files " + projectPath;
}

return null;
}


// Set up event dispatch
EventDispatcher.makeEventDispatcher(exports);

Expand Down Expand Up @@ -672,9 +650,6 @@ define(function (require, exports, module) {
_proxyDeprecatedEvent("workingSetSort");
});


PreferencesManager.convertPreferences(module, {"files_": "user"}, true, _checkPreferencePrefix);

// Handle file saves that may affect preferences
exports.on("documentSaved", function (e, doc) {
PreferencesManager.fileChanged(doc.file.fullPath);
Expand Down
15 changes: 0 additions & 15 deletions src/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2594,21 +2594,6 @@ define(function (require, exports, module) {
});
});

/**
* @private
*
* Manage the conversion from old-style localStorage prefs to the new file-based ones.
*/
function _convertPreferences() {
var rules = {};
editorOptions.forEach(function (setting) {
rules[setting] = "user";
});
PreferencesManager.convertPreferences(module, rules);
}

_convertPreferences();

// Define public API
exports.Editor = Editor;
exports.BOUNDARY_CHECK_NORMAL = BOUNDARY_CHECK_NORMAL;
Expand Down
5 changes: 0 additions & 5 deletions src/extensions/default/QuickView/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,6 @@ define(function (require, exports, module) {
CommandManager.register(Strings.CMD_ENABLE_QUICK_VIEW, CMD_ENABLE_QUICK_VIEW, toggleEnableQuickView);
Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(CMD_ENABLE_QUICK_VIEW, null, Menus.AFTER, Commands.VIEW_TOGGLE_INSPECTION);

// Convert old preferences
PreferencesManager.convertPreferences(module, {
"enabled": "user quickview.enabled"
});

// Setup initial UI state
setEnabled(prefs.get("enabled"), true);
setExtensionlessImagePreview(prefs.get("extensionlessImagePreview"), true);
Expand Down
2 changes: 0 additions & 2 deletions src/extensions/default/RecentProjects/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,6 @@ define(function (require, exports, module) {
}
}

PreferencesManager.convertPreferences(module, {"recentProjects": "user"}, true);

// Register command handlers
CommandManager.register(Strings.CMD_TOGGLE_RECENT_PROJECTS, TOGGLE_DROPDOWN, handleKeyEvent);
KeyBindingManager.addBinding(TOGGLE_DROPDOWN, KeyboardPrefs.recentProjects);
Expand Down
5 changes: 0 additions & 5 deletions src/language/CodeInspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ define(function (require, exports, module) {

var prefs = PreferencesManager.getExtensionPrefs("linting");

PreferencesManager.convertPreferences(module, {
"enabled": "user linting.enabled",
"collapsed": "user linting.collapsed"
});

/**
* When disabled, the errors panel is closed and the status bar icon is grayed out.
* Takes precedence over _collapsed.
Expand Down
272 changes: 0 additions & 272 deletions src/preferences/PreferenceStorage.js

This file was deleted.

Loading

0 comments on commit d6ae906

Please sign in to comment.