Support 'naked' selection globs in file dialog

This commit is contained in:
Bradley Austin Davis 2016-02-03 10:59:50 -08:00
parent 320c4d27b5
commit 8f85abfec8

View file

@ -17,9 +17,13 @@ VrControls.ComboBox {
onCurrentTextChanged: { onCurrentTextChanged: {
var globRegex = /\((.*)\)$/ var globRegex = /\((.*)\)$/
var globs = globRegex.exec(currentText); var globs = globRegex.exec(currentText);
if (!globs[1]) { if (!globs || !globs[1]) {
console.warn("Unable to parse filter " + currentText); globRegex = /^(\*.*)$/
return; globs = globRegex.exec(currentText);
if (!globs || !globs[1]) {
console.warn("Unable to parse filter " + currentText);
return;
}
} }
currentFilter = globs[1].split(" "); currentFilter = globs[1].split(" ");
} }