mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 01:04:06 +02:00
Move JSON parsing for custom dialog to be sooner
This commit is contained in:
parent
91714aaca6
commit
530e17a7e5
1 changed files with 9 additions and 7 deletions
|
@ -349,12 +349,8 @@ QVariant OffscreenUi::getCustomInfo(const Icon icon, const QString& title, const
|
|||
}
|
||||
|
||||
QVariant result = DependencyManager::get<OffscreenUi>()->customInputDialog(icon, title, config);
|
||||
if (result.isValid()) {
|
||||
// We get a JSON encoded result, so we unpack it into a QVariant wrapping a QVariantMap
|
||||
result = QVariant(QJsonDocument::fromJson(result.toString().toUtf8()).object().toVariantMap());
|
||||
if (ok) {
|
||||
*ok = true;
|
||||
}
|
||||
if (ok && result.isValid()) {
|
||||
*ok = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -386,7 +382,13 @@ QVariant OffscreenUi::customInputDialog(const Icon icon, const QString& title, c
|
|||
return result;
|
||||
}
|
||||
|
||||
return waitForInputDialogResult(createCustomInputDialog(icon, title, config));
|
||||
QVariant result = waitForInputDialogResult(createCustomInputDialog(icon, title, config));
|
||||
if (result.isValid()) {
|
||||
// We get a JSON encoded result, so we unpack it into a QVariant wrapping a QVariantMap
|
||||
result = QVariant(QJsonDocument::fromJson(result.toString().toUtf8()).object().toVariantMap());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void OffscreenUi::togglePinned() {
|
||||
|
|
Loading…
Reference in a new issue