diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-03-23 20:11:31 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-03-23 20:11:31 +0100 |
commit | 238cd13469935ec908b6d179839b7b7b435cb2be (patch) | |
tree | 986856a871bb21e2a38ed9ece27b6e00d5bf1746 /utils/rbutilqt/base | |
parent | f3b19de594bc68449fab0f42426e971bae2c7ad9 (diff) | |
download | rockbox-238cd13469935ec908b6d179839b7b7b435cb2be.tar.gz rockbox-238cd13469935ec908b6d179839b7b7b435cb2be.zip |
rbutil: Fix build info list handling with Qt6.
With Qt6 we need to check the type differently or we'd convert a
stringlist to a string.
Change-Id: I00a7a73535503b97f40edb51099a332902e881e0
Diffstat (limited to 'utils/rbutilqt/base')
-rw-r--r-- | utils/rbutilqt/base/playerbuildinfo.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/rbutilqt/base/playerbuildinfo.cpp b/utils/rbutilqt/base/playerbuildinfo.cpp index aba377eafc..195c170f0e 100644 --- a/utils/rbutilqt/base/playerbuildinfo.cpp +++ b/utils/rbutilqt/base/playerbuildinfo.cpp | |||
@@ -137,9 +137,9 @@ QVariant PlayerBuildInfo::value(BuildInfo item, BuildType type) | |||
137 | break; | 137 | break; |
138 | } | 138 | } |
139 | 139 | ||
140 | QVariant result = QString(); | 140 | QVariant result; |
141 | if (!serverInfo) | 141 | if (!serverInfo) |
142 | return result; | 142 | return QString(); |
143 | QStringList version = serverInfo->value(buildtypename + "/" + target, "").toStringList(); | 143 | QStringList version = serverInfo->value(buildtypename + "/" + target, "").toStringList(); |
144 | serverinfo.replace(":build:", buildtypename); | 144 | serverinfo.replace(":build:", buildtypename); |
145 | serverinfo.replace(":version:", version.at(0)); | 145 | serverinfo.replace(":version:", version.at(0)); |
@@ -149,7 +149,7 @@ QVariant PlayerBuildInfo::value(BuildInfo item, BuildType type) | |||
149 | // For invalid data return an empty string. | 149 | // For invalid data return an empty string. |
150 | if(version.at(0).isEmpty()) { | 150 | if(version.at(0).isEmpty()) { |
151 | LOG_INFO() << serverinfo << "(version invalid)"; | 151 | LOG_INFO() << serverinfo << "(version invalid)"; |
152 | return result; | 152 | return QString(); |
153 | } | 153 | } |
154 | if(!serverinfo.isEmpty()) | 154 | if(!serverinfo.isEmpty()) |
155 | result = serverInfo->value(serverinfo); | 155 | result = serverInfo->value(serverinfo); |
@@ -189,7 +189,11 @@ QVariant PlayerBuildInfo::value(BuildInfo item, BuildType type) | |||
189 | // if the value is a string we can replace some patterns. | 189 | // if the value is a string we can replace some patterns. |
190 | // if we cannot convert it (f.e. for a QStringList) we leave as-is, since | 190 | // if we cannot convert it (f.e. for a QStringList) we leave as-is, since |
191 | // the conversion would return an empty type. | 191 | // the conversion would return an empty type. |
192 | if (result.canConvert(QMetaType::QString)) | 192 | #if QT_VERSION < 0x060000 |
193 | if (result.type() == QVariant::String) | ||
194 | #else | ||
195 | if (result.metaType().id() == QMetaType::QString) | ||
196 | #endif | ||
193 | result = result.toString() | 197 | result = result.toString() |
194 | .replace("%TARGET%", target) | 198 | .replace("%TARGET%", target) |
195 | .replace("%VERSION%", version.at(0)); | 199 | .replace("%VERSION%", version.at(0)); |