Merge pull request #3587 from ctrlaltdavid/20101

CR for Job #20101 - Upload model file function is broken
This commit is contained in:
Clément Brisset 2014-10-13 16:16:49 -07:00
commit f6f187e7f0
3 changed files with 6 additions and 2 deletions

View file

@ -1312,7 +1312,6 @@ var toolBar = (function () {
if (clickedOverlay === loadFileMenuItem) {
toggleNewModelButton(false);
// TODO BUG: this is bug, if the user has never uploaded a model, this will throw an JS exception
file = Window.browse("Select your model file ...",
Settings.getValue("LastModelUploadLocation").path(),
"Model files (*.fst *.fbx)");

View file

@ -238,7 +238,6 @@ var toolBar = (function () {
if (clickedOverlay === loadFileMenuItem) {
toggleNewModelButton(false);
// TODO BUG: this is bug, if the user has never uploaded a model, this will throw an JS exception
file = Window.browse("Select your model file ...",
Settings.getValue("LastModelUploadLocation").path(),
"Model files (*.fst *.fbx)");

View file

@ -22,6 +22,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting) {
QSettings* settings = Application::getInstance()->lockSettings();
QVariant value = settings->value(setting);
Application::getInstance()->unlockSettings();
if (!value.isValid()) {
value = "";
}
return value;
}
@ -29,6 +32,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting, const QVar
QSettings* settings = Application::getInstance()->lockSettings();
QVariant value = settings->value(setting, defaultValue);
Application::getInstance()->unlockSettings();
if (!value.isValid()) {
value = "";
}
return value;
}