mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:53:25 +02:00
Fix model uploading for the case that haven't uploaded model before
This commit is contained in:
parent
324ddb2a2f
commit
c6bf09f509
3 changed files with 6 additions and 2 deletions
|
@ -1312,7 +1312,6 @@ var toolBar = (function () {
|
||||||
if (clickedOverlay === loadFileMenuItem) {
|
if (clickedOverlay === loadFileMenuItem) {
|
||||||
toggleNewModelButton(false);
|
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 ...",
|
file = Window.browse("Select your model file ...",
|
||||||
Settings.getValue("LastModelUploadLocation").path(),
|
Settings.getValue("LastModelUploadLocation").path(),
|
||||||
"Model files (*.fst *.fbx)");
|
"Model files (*.fst *.fbx)");
|
||||||
|
|
|
@ -238,7 +238,6 @@ var toolBar = (function () {
|
||||||
if (clickedOverlay === loadFileMenuItem) {
|
if (clickedOverlay === loadFileMenuItem) {
|
||||||
toggleNewModelButton(false);
|
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 ...",
|
file = Window.browse("Select your model file ...",
|
||||||
Settings.getValue("LastModelUploadLocation").path(),
|
Settings.getValue("LastModelUploadLocation").path(),
|
||||||
"Model files (*.fst *.fbx)");
|
"Model files (*.fst *.fbx)");
|
||||||
|
|
|
@ -22,6 +22,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting) {
|
||||||
QSettings* settings = Application::getInstance()->lockSettings();
|
QSettings* settings = Application::getInstance()->lockSettings();
|
||||||
QVariant value = settings->value(setting);
|
QVariant value = settings->value(setting);
|
||||||
Application::getInstance()->unlockSettings();
|
Application::getInstance()->unlockSettings();
|
||||||
|
if (!value.isValid()) {
|
||||||
|
value = "";
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +32,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting, const QVar
|
||||||
QSettings* settings = Application::getInstance()->lockSettings();
|
QSettings* settings = Application::getInstance()->lockSettings();
|
||||||
QVariant value = settings->value(setting, defaultValue);
|
QVariant value = settings->value(setting, defaultValue);
|
||||||
Application::getInstance()->unlockSettings();
|
Application::getInstance()->unlockSettings();
|
||||||
|
if (!value.isValid()) {
|
||||||
|
value = "";
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue