From 01af231084d5ed23dfad5571eb633624d56f0cf2 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 19 Apr 2023 23:10:34 +0300 Subject: [PATCH] Fixed Json conversion on Qt6 --- ChangeLog.md | 2 ++ launcher/firstLaunch/firstlaunch_moc.cpp | 2 +- launcher/jsonutils.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2a3d2965d..ea15567f8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,8 @@ ### GENERAL: * Fixed movement cost penalty from terrain +* Fixed blocked progress in Launcher on language detection failure +* Launcher will now correctly handle selection of Data directory in H3 install # 1.1.1 -> 1.2.0 diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp index 10253d26e..2836cf41f 100644 --- a/launcher/firstLaunch/firstlaunch_moc.cpp +++ b/launcher/firstLaunch/firstlaunch_moc.cpp @@ -190,7 +190,7 @@ void FirstLaunchView::heroesDataMissing() ui->labelDataCopy->setVisible(true); ui->labelDataFound->setVisible(false); - ui->pushButtonDataNext->setEnabled(true); + ui->pushButtonDataNext->setEnabled(false); if(hasVCMIBuilderScript) { diff --git a/launcher/jsonutils.cpp b/launcher/jsonutils.cpp index 9b144cb8a..6906da1dc 100644 --- a/launcher/jsonutils.cpp +++ b/launcher/jsonutils.cpp @@ -96,14 +96,14 @@ JsonNode toJson(QVariant object) { JsonNode ret; - if(object.canConvert()) - ret.Struct() = VariantToMap(object.toMap()); - else if(object.canConvert()) - ret.Vector() = VariantToList(object.toList()); - else if(object.userType() == QMetaType::QString) + if(object.userType() == QMetaType::QString) ret.String() = object.toString().toUtf8().data(); else if(object.userType() == QMetaType::Bool) ret.Bool() = object.toBool(); + else if(object.canConvert()) + ret.Struct() = VariantToMap(object.toMap()); + else if(object.canConvert()) + ret.Vector() = VariantToList(object.toList()); else if(object.canConvert()) ret.Integer() = object.toInt(); else if(object.canConvert())