File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 26
26
#include < QJsonObject>
27
27
#include < QUrl>
28
28
#include < QDomDocument>
29
+ #include < QRegularExpression>
29
30
30
31
QgsGeoNodeRequest::QgsGeoNodeRequest ( const QString &baseUrl, bool forceRefresh, QObject *parent )
31
32
: QObject( parent )
@@ -272,9 +273,18 @@ QList<QgsGeoNodeRequest::ServiceLayerDetail> QgsGeoNodeRequest::parseLayers( con
272
273
qint16 minorVersion;
273
274
if ( jsonVariantMap.contains ( QStringLiteral ( " geonode_version" ) ) )
274
275
{
275
- const QStringList geonodeVersionSplit = jsonVariantMap.value ( QStringLiteral ( " geonode_version" ) ).toString ().split ( ' .' );
276
- majorVersion = geonodeVersionSplit.at ( 0 ).toInt ();
277
- minorVersion = geonodeVersionSplit.at ( 1 ).toInt ();
276
+ QRegularExpression re ( " ((\\ d+)(\\ .\\ d+))" );
277
+ QRegularExpressionMatch match = re.match ( jsonVariantMap.value ( QStringLiteral ( " geonode_version" ) ).toString () );
278
+ if ( match.hasMatch () )
279
+ {
280
+ const QStringList geonodeVersionSplit = match.captured ( 0 ).split ( ' .' );
281
+ majorVersion = geonodeVersionSplit.at ( 0 ).toInt ();
282
+ minorVersion = geonodeVersionSplit.at ( 1 ).toInt ();
283
+ }
284
+ else
285
+ {
286
+ return layers;
287
+ }
278
288
}
279
289
else
280
290
{
You can’t perform that action at this time.
0 commit comments