diff options
author | Albin Olsson <albin.olsson@cybercom.com> | 2013-08-29 15:21:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-30 13:30:15 +0200 |
commit | 4ff9f86051cb8710c97a7d6b9c60a911e46694c6 (patch) | |
tree | 0511e7931bed7bba41188c96bab50a90e84aa971 | |
parent | 912bd3033d3e53ee113b92bf9be967a25f233c66 (diff) |
Fix bug where getDetails() could invalidate icon url.
QQmlProperty map cannot remove values, only "clear" them. When they were
converted to a QVariantMap (for retrieving url) cleared values would
be sent as invalid QVariants, which caused the url fetch to fail.
Solution is to check for invalid qvariants.
Change-Id: Ifd9407b3217edbd2d5a1702915f82c46f3c5f498
Reviewed-by: Albin Olsson <albin.olsson@cybercom.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r-- | src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp index 669faa04..3a93ae11 100644 --- a/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativeplaceicon.cpp @@ -120,9 +120,12 @@ QPlaceIcon QDeclarativePlaceIcon::icon() const result.setManager(0); QVariantMap params; - foreach (const QString &key, m_parameters->keys()) - params.insert(key, m_parameters->value(key)); - + foreach (const QString &key, m_parameters->keys()) { + const QVariant value = m_parameters->value(key); + if (value.isValid()) { + params.insert(key, value); + } + } result.setParameters(params); |