summaryrefslogtreecommitdiff
path: root/utils/rbutilqt/base
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rbutilqt/base')
-rw-r--r--utils/rbutilqt/base/playerbuildinfo.cpp12
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));