Potential OSX fix plus extra logging

This commit is contained in:
David Rowe 2016-05-21 13:03:58 +12:00
parent 17b3101ca5
commit 5a27d656c5

View file

@ -130,17 +130,23 @@ ModalWindow {
choices = [], choices = [],
i, length; i, length;
console.log("####### folder parts: " + JSON.stringify(folders));
if (folders[folders.length - 1] === "") { if (folders[folders.length - 1] === "") {
folders.pop(); folders.pop();
} }
if (folders[0] !== "") { choices.push(folders[0]);
choices.push(folders[0]);
}
for (i = 1, length = folders.length; i < length; i++) { for (i = 1, length = folders.length; i < length; i++) {
choices.push(choices[i - 1] + "/" + folders[i]); choices.push(choices[i - 1] + "/" + folders[i]);
} }
if (folders[0] === "") {
// Special handling for OSX root dir.
choices[0] = "/";
}
choices.reverse(); choices.reverse();
if (drives && drives.length > 1) { if (drives && drives.length > 1) {
@ -154,6 +160,9 @@ ModalWindow {
onLastValidFolderChanged: { onLastValidFolderChanged: {
var folder = d.capitalizeDrive(lastValidFolder); var folder = d.capitalizeDrive(lastValidFolder);
console.log("####### lastValidFolder: " + folder);
calculatePathChoices(folder); calculatePathChoices(folder);
} }