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

Commit

Permalink
Fix issue #1221 (Quick Open lists git metafiles) -- Expose ProjectMan…
Browse files Browse the repository at this point in the history
…ager's

existing file/folder filtering logic as a public API, and use it in
FileIndexManager too for consistency (which provides the file list for
Quick Open).
  • Loading branch information
peterflynn committed Jul 10, 2012
1 parent 37ece14 commit b09165b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/project/FileIndexManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ define(function (require, exports, module) {
//
function _addFileToIndexes(entry) {

// skip invisible files on mac
if (brackets.platform === "mac" && entry.name.charAt(0) === ".") {
// skip invisible files
if (!ProjectManager.shouldShow(entry)) {
return;
}

Expand Down Expand Up @@ -195,8 +195,8 @@ define(function (require, exports, module) {

// inner helper function
function _scanDirectoryRecurse(dirEntry) {
// skip invisible directories on mac
if (brackets.platform === "mac" && dirEntry.name.charAt(0) === ".") {
// skip invisible directories
if (!ProjectManager.shouldShow(dirEntry)) {
return;
}

Expand Down
5 changes: 3 additions & 2 deletions src/project/ProjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ define(function (require, exports, module) {
}

/** @param {Entry} entry File or directory to filter */
function _shouldShowInTree(entry) {
function shouldShow(entry) {
return [".git", ".svn", ".DS_Store", "Thumbs.db"].indexOf(entry.name) === -1;
}

Expand All @@ -484,7 +484,7 @@ define(function (require, exports, module) {
for (entryI = 0; entryI < entries.length; entryI++) {
entry = entries[entryI];

if (_shouldShowInTree(entry)) {
if (shouldShow(entry)) {
var jsonEntry = {
data: entry.name,
attr: { id: "node" + _projectInitialLoad.id++ },
Expand Down Expand Up @@ -892,6 +892,7 @@ define(function (require, exports, module) {
exports.getProjectRoot = getProjectRoot;
exports.isWithinProject = isWithinProject;
exports.makeProjectRelativeIfPossible = makeProjectRelativeIfPossible;
exports.shouldShow = shouldShow;
exports.openProject = openProject;
exports.loadProject = loadProject;
exports.getSelectedItem = getSelectedItem;
Expand Down

0 comments on commit b09165b

Please # to comment.