summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <[email protected]>2017-12-21 20:06:38 +0100
committerVolker Krause <[email protected]>2017-12-21 20:06:38 +0100
commit9e53c9efa3026dc34fad947d879c5e4688972cac (patch)
treeccaebb207837932d9a6e12c0452fcfa5f8ebaca1
parenta38d53b1d9bc4ba0ec402d3be7c64ce3d5e1cc21 (diff)
Fix decoding of float/double property values
This fixes reading train station geo coordinates from trainline.eu booking confirmations.
-rw-r--r--plugins/messageviewer/bodypartformatter/semantic/jsonlddocument.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/messageviewer/bodypartformatter/semantic/jsonlddocument.cpp b/plugins/messageviewer/bodypartformatter/semantic/jsonlddocument.cpp
index 9ac9f5a..64193f7 100644
--- a/plugins/messageviewer/bodypartformatter/semantic/jsonlddocument.cpp
+++ b/plugins/messageviewer/bodypartformatter/semantic/jsonlddocument.cpp
@@ -52,9 +52,13 @@ static QVariant propertyValue(const QMetaProperty &prop, const QJsonValue &v)
}
return dt;
}
+ case QVariant::Double:
+ return v.toDouble();
default:
break;
}
+ if (prop.type() == qMetaTypeId<float>())
+ return v.toDouble();
return createInstance(v.toObject());
}