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

Issue: #3217 Remove preferences migration code #5429

Merged
merged 1 commit into from
Oct 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions src/LiveDevelopment/main.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
*/


Expand Down Expand Up @@ -142,7 +142,7 @@ define(function main(require, exports, module) {

/** Called on status change */
function _showStatusChangeReason(reason) {
// Destroy the previous twipsy (options are not updated otherwise)
// Destroy the previous twipsy (options are not updated otherwise)
_$btnGoLive.twipsy("hide").removeData("twipsy");

// If there was no reason or the action was an explicit request by the user, don't show a twipsy
Expand Down Expand Up @@ -178,7 +178,7 @@ define(function main(require, exports, module) {
});
$(LiveDevelopment).on("statusChange", function statusChange(event, status, reason) {
// status starts at -1 (error), so add one when looking up name and style
// See the comments at the top of LiveDevelopment.js for details on the
// See the comments at the top of LiveDevelopment.js for details on the
// various status codes.
_setLabel(_$btnGoLive, null, _statusStyle[status + 1], _statusTooltip[status + 1]);
_showStatusChangeReason(reason);
Expand All @@ -195,7 +195,7 @@ define(function main(require, exports, module) {
function _setupGoLiveMenu() {
$(LiveDevelopment).on("statusChange", function statusChange(event, status) {
// Update the checkmark next to 'Live Preview' menu item
// Add checkmark when status is STATUS_ACTIVE; otherwise remove it
// Add checkmark when status is STATUS_ACTIVE; otherwise remove it
CommandManager.get(Commands.FILE_LIVE_FILE_PREVIEW).setChecked(status === LiveDevelopment.STATUS_ACTIVE);
CommandManager.get(Commands.FILE_LIVE_HIGHLIGHT).setEnabled(status === LiveDevelopment.STATUS_ACTIVE);
});
Expand Down Expand Up @@ -257,8 +257,6 @@ define(function main(require, exports, module) {

// init prefs
prefs = PreferencesManager.getPreferenceStorage(module, {highlight: true});
//TODO: Remove preferences migration code
PreferencesManager.handleClientIdChange(prefs, "com.adobe.brackets.live-development");

config.highlight = prefs.getValue("highlight");

Expand Down
2 changes: 0 additions & 2 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ define(function (require, exports, module) {
// an old version that might not have set the "afterFirstLaunch" pref.)
var prefs = PreferencesManager.getPreferenceStorage(module),
deferred = new $.Deferred();
//TODO: Remove preferences migration code
PreferencesManager.handleClientIdChange(prefs, "com.adobe.brackets.startup");

if (!params.get("skipSampleProjectLoad") && !prefs.getValue("afterFirstLaunch")) {
prefs.setValue("afterFirstLaunch", "true");
Expand Down
48 changes: 23 additions & 25 deletions src/document/DocumentManager.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
*/


Expand All @@ -28,15 +28,15 @@
/**
* DocumentManager maintains a list of currently 'open' Documents. It also owns the list of files in
* the working set, and the notion of which Document is currently shown in the main editor UI area.
*
*
* Document is the model for a file's contents; it dispatches events whenever those contents change.
* To transiently inspect a file's content, simply get a Document and call getText() on it. However,
* to be notified of Document changes or to modify a Document, you MUST call addRef() to ensure the
* Document instance 'stays alive' and is shared by all other who read/modify that file. ('Open'
* Documents are all Documents that are 'kept alive', i.e. have ref count > 0).
*
* To get a Document, call getDocumentForPath(); never new up a Document yourself.
*
*
* Secretly, a Document may use an Editor instance to act as the model for its internal state. (This
* is unavoidable because CodeMirror does not separate its model from its UI). Documents are not
* modifiable until they have a backing 'master Editor'. Creation of the backing Editor is owned by
Expand All @@ -54,7 +54,7 @@
*
* - dirtyFlagChange -- When any Document's isDirty flag changes. The 2nd arg to the listener is the
* Document whose flag changed.
* - documentSaved -- When a Document's changes have been saved. The 2nd arg to the listener is the
* - documentSaved -- When a Document's changes have been saved. The 2nd arg to the listener is the
* Document that has been saved.
* - documentRefreshed -- When a Document's contents have been reloaded from disk. The 2nd arg to the
* listener is the Document that has been refreshed.
Expand All @@ -72,7 +72,7 @@
* The 2nd arg to the listener is the array of removed FileEntry objects.
* - workingSetSort -- When the workingSet array is reordered without additions or removals.
* Listener receives no arguments.
*
*
* - workingSetDisableAutoSorting -- Dispatched in addition to workingSetSort when the reorder was caused
* by manual dragging and dropping. Listener receives no arguments.
*
Expand All @@ -82,7 +82,7 @@
*
* These are jQuery events, so to listen for them you do something like this:
* $(DocumentManager).on("eventname", handler);
*
*
* Document objects themselves also dispatch some events - see Document docs for details.
*/
define(function (require, exports, module) {
Expand Down Expand Up @@ -182,7 +182,7 @@ define(function (require, exports, module) {
return _workingSet.slice(0);
}

/**
/**
* Returns the index of the file matching fullPath in the working set.
* Returns -1 if not found.
* @param {!string} fullPath
Expand All @@ -198,7 +198,7 @@ define(function (require, exports, module) {
});
}

/**
/**
* Returns the index of the file matching fullPath in _workingSetAddedOrder.
* Returns -1 if not found.
* @param {!string} fullPath
Expand Down Expand Up @@ -465,7 +465,7 @@ define(function (require, exports, module) {
* Changes currentDocument to the given Document, firing currentDocumentChange, which in turn
* causes this Document's main editor UI to be shown in the editor pane, updates the selection
* in the file tree / working set UI, etc. This call may also add the item to the working set.
*
*
* @param {!Document} document The Document to make current. May or may not already be in the
* working set.
*/
Expand Down Expand Up @@ -543,7 +543,7 @@ define(function (require, exports, module) {
.fail(function () {
// File chosen to be switched to could not be opened, and the original file
// is still in editor. Close it again so code will try to open the next file,
// or empty the editor if there are no other files.
// or empty the editor if there are no other files.
closeFullEditor(file);
});
} else {
Expand Down Expand Up @@ -817,7 +817,7 @@ define(function (require, exports, module) {
* @param {boolean} isFolder True if path is a folder; False if it is a file.
*/
function notifyPathNameChanged(oldName, newName, isFolder) {
// Update open documents. This will update _currentDocument too, since
// Update open documents. This will update _currentDocument too, since
// the current document is always open.
var keysToDelete = [];
CollectionUtils.forEach(_openDocuments, function (doc, path) {
Expand Down Expand Up @@ -849,7 +849,7 @@ define(function (require, exports, module) {
}

/**
* Called after a file or folder has been deleted. This function is responsible
* Called after a file or folder has been deleted. This function is responsible
* for updating underlying model data and notifying all views of the change.
*
* @param {string} path The path of the file/folder that has been deleted
Expand Down Expand Up @@ -953,8 +953,6 @@ define(function (require, exports, module) {

// Setup preferences
_prefs = PreferencesManager.getPreferenceStorage(module);
//TODO: Remove preferences migration code
PreferencesManager.handleClientIdChange(_prefs, "com.adobe.brackets.DocumentManager");

// Performance measurements
PerfUtils.createPerfMeasurement("DOCUMENT_MANAGER_GET_DOCUMENT_FOR_PATH", "DocumentManager.getDocumentForPath()");
Expand Down
Loading