Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
humphd committed Aug 1, 2017
1 parent 837718e commit d07a5e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 31 deletions.
24 changes: 6 additions & 18 deletions src/filesystem/impls/filer/ArchiveUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ define(function (require, exports, module) {
// zipfile can be a path (string) to a zipfile, or raw binary data.
function unzip(zipfile, options, callback) {
var projectPrefix = StartupState.project("zipFilenamePrefix").replace(/\/?$/, "/");
var pathsToOpen = [];

if(typeof options === 'function') {
callback = options;
Expand Down Expand Up @@ -110,13 +109,7 @@ define(function (require, exports, module) {
var basedir = Path.dirname(path.absPath);

function writeFile() {
FilerUtils
.writeFileAsBinary(path.absPath, path.data)
.done(function() {
pathsToOpen.push(path.absPath);
callback();
})
.fail(callback);
FilerUtils.writeFileAsBinary(path.absPath, path.data, callback);
}

if(path.isDirectory) {
Expand Down Expand Up @@ -158,7 +151,8 @@ define(function (require, exports, module) {
DefaultDialogs.DIALOG_ID_INFO,
Strings.DND_SUCCESS_UNZIP_TITLE
).getPromise().then(function() {
callback(null, pathsToOpen);
// We don't bother sending a list of files to open for archives.
callback(null, []);
}, callback);
});
});
Expand Down Expand Up @@ -258,7 +252,6 @@ define(function (require, exports, module) {
options = options || {};
callback = callback || function(){};

var pathsToOpen = [];
var untarWorker = new Worker("thirdparty/bitjs/bitjs-untar.min.js");
var root = options.root || StartupState.project("root");
var pending = null;
Expand All @@ -276,13 +269,7 @@ define(function (require, exports, module) {
return callback(err);
}

FilerUtils
.writeFileAsBinary(path, new Buffer(data))
.done(function() {
pathsToOpen.push(path.absPath);
callback();
})
.fail(callback);
FilerUtils.writeFileAsBinary(path, new Buffer(data), callback);
});
}

Expand All @@ -299,7 +286,8 @@ define(function (require, exports, module) {
DefaultDialogs.DIALOG_ID_INFO,
Strings.DND_SUCCESS_UNTAR_TITLE
).getPromise().then(function() {
callback(null, pathsToOpen);
// We don't bother sending a list of files to open for archives.
callback(null, []);
}, callback);
});
}
Expand Down
22 changes: 9 additions & 13 deletions src/project/FileViewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ define(function (require, exports, module) {
*/
EventDispatcher.on_duringInit(MainViewManager, "workingSetAdd", function (event, addedFile) {
// XXXBramble: always keep focus on the Project Manager vs. Working Set View
_fileSelectionFocus = WORKING_SET_VIEW;
_fileSelectionFocus = PROJECT_MANAGER;
exports.trigger("documentSelectionFocusChange");
});
/**
Expand All @@ -87,11 +87,11 @@ define(function (require, exports, module) {
if (!_curDocChangedDueToMe) {
// The the cause of the doc change was not openAndSelectDocument, so pick the best fileSelectionFocus
perfTimerName = PerfUtils.markStart("FileViewController._oncurrentFileChange():\t" + (file ? (file.fullPath) : "(no open file)"));

// XXXBramble: always keep focus on the Project Manager vs. Working Set View
_fileSelectionFocus = PROJECT_MANAGER;
}

// XXXBramble: always keep focus on the Project Manager vs. Working Set View
_fileSelectionFocus = PROJECT_MANAGER;

exports.trigger("documentSelectionFocusChange");

if (!_curDocChangedDueToMe) {
Expand Down Expand Up @@ -125,13 +125,9 @@ define(function (require, exports, module) {
console.error("Bad parameter passed to FileViewController.setFileViewFocus");
return;
}
// XXXBramble: always keep focus on the Project Manager vs. Working Set View
fileSelectionFocus = PROJECT_MANAGER;

if (_fileSelectionFocus !== fileSelectionFocus) {
_fileSelectionFocus = fileSelectionFocus;
exports.trigger("fileViewFocusChange");
}
// XXXBramble: always keep focus on the Project Manager vs. Working Set View
_fileSelectionFocus = PROJECT_MANAGER;
exports.trigger("fileViewFocusChange");
}

/**
Expand Down Expand Up @@ -169,8 +165,8 @@ define(function (require, exports, module) {
// and checked in the currentFileChange handler
_curDocChangedDueToMe = true;

_fileSelectionFocus = fileSelectionFocus;

// XXXBramble: always keep focus on the Project Manager vs. Working Set View
_fileSelectionFocus = PROJECT_MANAGER;

paneId = (paneId || _getDerivedPaneContext() || MainViewManager.ACTIVE_PANE);

Expand Down

0 comments on commit d07a5e9

Please sign in to comment.