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: {
var globRegex = /\((.*)\)$/
var globs = globRegex.exec(currentText);
if (!globs[1]) {
console.warn("Unable to parse filter " + currentText);
return;
if (!globs || !globs[1]) {
globRegex = /^(\*.*)$/
globs = globRegex.exec(currentText);
if (!globs || !globs[1]) {
console.warn("Unable to parse filter " + currentText);
return;
}
}
currentFilter = globs[1].split(" ");
}