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

Commit 00be532

Browse files
author
Narciso Jaramillo
committed
Merge branch 'master' into cmv4
2 parents 6a18975 + e4c289f commit 00be532

6 files changed

Lines changed: 48 additions & 23 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Brackets",
3-
"version": "0.37.0-0",
4-
"apiVersion": "0.37.0",
3+
"version": "0.38.0-0",
4+
"apiVersion": "0.38.0",
55
"homepage": "http://brackets.io",
66
"issues": {
77
"url": "http://github.com/adobe/brackets/issues"

src/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"linting.enabled_by_default": true
2020
},
2121
"name": "Brackets",
22-
"version": "0.37.0-0",
23-
"apiVersion": "0.37.0",
22+
"version": "0.38.0-0",
23+
"apiVersion": "0.38.0",
2424
"homepage": "http://brackets.io",
2525
"issues": {
2626
"url": "http://github.com/adobe/brackets/issues"
@@ -58,7 +58,7 @@
5858
},
5959
"scripts": {
6060
"postinstall": "grunt install",
61-
"test": "grunt test"
61+
"test": "grunt cla-check-pull test"
6262
},
6363
"licenses": [
6464
{

src/filesystem/FileSystem.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ define(function (require, exports, module) {
9292
var Directory = require("filesystem/Directory"),
9393
File = require("filesystem/File"),
9494
FileIndex = require("filesystem/FileIndex"),
95+
FileSystemError = require("filesystem/FileSystemError"),
9596
WatchedRoot = require("filesystem/WatchedRoot");
9697

9798
/**
@@ -886,7 +887,7 @@ define(function (require, exports, module) {
886887
callback = callback || function () {};
887888

888889
if (!watchedRoot) {
889-
callback("Root is not watched.");
890+
callback(FileSystemError.ROOT_NOT_WATCHED);
890891
return;
891892
}
892893

src/filesystem/FileSystemError.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ define(function (require, exports, module) {
3535
"use strict";
3636

3737
module.exports = {
38-
UNKNOWN : "Unknown",
39-
INVALID_PARAMS : "InvalidParams",
40-
NOT_FOUND : "NotFound",
41-
NOT_READABLE : "NotReadable",
42-
NOT_WRITABLE : "NotWritable",
43-
OUT_OF_SPACE : "OutOfSpace",
44-
TOO_MANY_ENTRIES : "TooManyEntries",
45-
ALREADY_EXISTS : "AlreadyExists",
46-
CONTENTS_MODIFIED : "ContentsModified"
38+
UNKNOWN : "Unknown",
39+
INVALID_PARAMS : "InvalidParams",
40+
NOT_FOUND : "NotFound",
41+
NOT_READABLE : "NotReadable",
42+
NOT_SUPPORTED : "NotSupported",
43+
NOT_WRITABLE : "NotWritable",
44+
OUT_OF_SPACE : "OutOfSpace",
45+
TOO_MANY_ENTRIES : "TooManyEntries",
46+
ALREADY_EXISTS : "AlreadyExists",
47+
CONTENTS_MODIFIED : "ContentsModified",
48+
ROOT_NOT_WATCHED : "RootNotBeingWatched"
49+
4750
// FUTURE: Add remote connection errors: timeout, not logged in, connection err, etc.
4851
};
4952
});

src/filesystem/impls/appshell/AppshellFileSystem.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ define(function (require, exports, module) {
4646
_domainPath = [_bracketsPath, _modulePath, _nodePath].join("/"),
4747
_nodeDomain = new NodeDomain("fileWatcher", _domainPath);
4848

49+
var _isRunningOnWindowsXP = navigator.userAgent.indexOf("Windows NT 5.") >= 0;
50+
4951
// If the connection closes, notify the FileSystem that watchers have gone offline.
5052
$(_nodeDomain.connection).on("close", function (event, promise) {
5153
if (_offlineCallback) {
@@ -485,11 +487,15 @@ define(function (require, exports, module) {
485487
* cleared when the offlineCallback is called.
486488
*
487489
* @param {function(?string, FileSystemStats=)} changeCallback
488-
* @param {function()=} callback
490+
* @param {function()=} offlineCallback
489491
*/
490492
function initWatchers(changeCallback, offlineCallback) {
491493
_changeCallback = changeCallback;
492494
_offlineCallback = offlineCallback;
495+
496+
if (_isRunningOnWindowsXP && _offlineCallback) {
497+
_offlineCallback();
498+
}
493499
}
494500

495501
/**
@@ -504,6 +510,10 @@ define(function (require, exports, module) {
504510
* @param {function(?string)=} callback
505511
*/
506512
function watchPath(path, callback) {
513+
if (_isRunningOnWindowsXP) {
514+
callback(FileSystemError.NOT_SUPPORTED);
515+
return;
516+
}
507517
appshell.fs.isNetworkDrive(path, function (err, isNetworkDrive) {
508518
if (err || isNetworkDrive) {
509519
callback(FileSystemError.UNKNOWN);
@@ -563,8 +573,7 @@ define(function (require, exports, module) {
563573
*
564574
* @type {boolean}
565575
*/
566-
exports.recursiveWatch = (appshell.platform === "mac" ||
567-
(appshell.platform === "win" && navigator.userAgent.indexOf("Windows NT 5.") === -1));
576+
exports.recursiveWatch = (appshell.platform === "mac" || appshell.platform === "win");
568577

569578
/**
570579
* Indicates whether or not the filesystem should expect and normalize UNC

src/project/ProjectManager.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,26 @@ define(function (require, exports, module) {
201201
*/
202202
var _allFilesCachePromise = null;
203203

204+
/**
205+
* @private
206+
* @type {boolean}
207+
* Current sort order for the tree, true if directories are first. This is
208+
* initialized in _generateSortPrefixes.
209+
*/
210+
var _dirFirst;
204211

205212
/**
206213
* @private
207214
* Generates the prefixes used for sorting the files in the project tree
215+
* @return {boolean} true if the sort prefixes have changed
208216
*/
209217
function _generateSortPrefixes() {
210-
var dirFirst = PreferencesManager.get("sortDirectoriesFirst");
211-
_sortPrefixDir = dirFirst ? "0" : "";
212-
_sortPrefixFile = dirFirst ? "1" : "";
218+
var previousDirFirst = _dirFirst;
219+
_dirFirst = PreferencesManager.get("sortDirectoriesFirst");
220+
_sortPrefixDir = _dirFirst ? "0" : "";
221+
_sortPrefixFile = _dirFirst ? "1" : "";
222+
223+
return previousDirFirst !== _dirFirst;
213224
}
214225

215226
/**
@@ -2207,8 +2218,9 @@ define(function (require, exports, module) {
22072218
// Initialize the sort prefixes and make sure to change them when the sort pref changes
22082219
_generateSortPrefixes();
22092220
PreferencesManager.on("change", "sortDirectoriesFirst", function () {
2210-
_generateSortPrefixes();
2211-
refreshFileTree();
2221+
if (_generateSortPrefixes()) {
2222+
refreshFileTree();
2223+
}
22122224
});
22132225

22142226
// Event Handlers

0 commit comments

Comments
 (0)