summaryrefslogtreecommitdiff
path: root/src/imports
diff options
context:
space:
mode:
authorAaron McCarthy <mccarthy.aaron@gmail.com>2014-12-12 15:54:20 +1000
committerAlex Blasche <alexander.blasche@theqtcompany.com>2014-12-16 15:27:30 +0100
commit322c8d0afcffe6e8dfea0a4b6b3da179faa4b3bb (patch)
treea606ab249dcd9fef68446b98e0222cc702a6043b /src/imports
parentb8681cdb51cc5d7040ecbe08b014bace2444c6f1 (diff)
downloadqtlocation-322c8d0afcffe6e8dfea0a4b6b3da179faa4b3bb.tar.gz
Don't reset error string on category fetch error.
The error string was being set and then immediately cleared by a subsequent call to setError(). Change-Id: I3b1b1bf921f0706afae4a553d2a891ef32317e59 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
index 507a4e14..6654512b 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2014 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
@@ -319,21 +320,21 @@ void QDeclarativeSupportedCategoriesModel::replyFinished()
if (!m_response)
return;
+ m_response->deleteLater();
+
if (m_response->error() == QPlaceReply::NoError) {
m_errorString.clear();
- m_response->deleteLater();
m_response = 0;
updateLayout();
setStatus(QDeclarativeSupportedCategoriesModel::Ready);
} else {
- m_errorString = m_response->errorString();
+ const QString errorString = m_response->errorString();
- m_response->deleteLater();
m_response = 0;
- setStatus(QDeclarativeSupportedCategoriesModel::Error);
+ setStatus(Error, errorString);
}
}
@@ -343,6 +344,9 @@ void QDeclarativeSupportedCategoriesModel::replyFinished()
void QDeclarativeSupportedCategoriesModel::addedCategory(const QPlaceCategory &category,
const QString &parentId)
{
+ if (m_response)
+ return;
+
if (!m_categoriesTree.contains(parentId))
return;
@@ -376,6 +380,9 @@ void QDeclarativeSupportedCategoriesModel::addedCategory(const QPlaceCategory &c
void QDeclarativeSupportedCategoriesModel::updatedCategory(const QPlaceCategory &category,
const QString &parentId)
{
+ if (m_response)
+ return;
+
QString categoryId = category.categoryId();
if (!m_categoriesTree.contains(parentId))
@@ -440,6 +447,9 @@ void QDeclarativeSupportedCategoriesModel::updatedCategory(const QPlaceCategory
*/
void QDeclarativeSupportedCategoriesModel::removedCategory(const QString &categoryId, const QString &parentId)
{
+ if (m_response)
+ return;
+
if (!m_categoriesTree.contains(categoryId) || !m_categoriesTree.contains(parentId))
return;