summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2011-08-24 13:57:42 +1000
committerAaron McCarthy <aaron.mccarthy@nokia.com>2011-08-24 07:17:37 +0200
commitb8e49782715d73bcdee1374073d938898a4c3cde (patch)
treece85dc58c5e1258a3ac07230fe6bbaba0f09fa18
parent9f43c2b83dfeb0fae109145f9f98119fb71134e2 (diff)
downloadqtlocation-b8e49782715d73bcdee1374073d938898a4c3cde.tar.gz
Add updating property to SupportedCategoriesModel.
Change-Id: I4c0ba0eed204ef2e0f7ac7cdef650b22014b7b44 Reviewed-on: http://codereview.qt.nokia.com/3438 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: abcd <qt_abcd1@ovi.com> Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp13
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
index 9046b49b..955c00a4 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp
@@ -178,6 +178,8 @@ void QDeclarativeSupportedCategoriesModel::setPlugin(QDeclarativeGeoServiceProvi
connect(m_response, SIGNAL(finished()), this, SLOT(replyFinished()));
connect(m_response, SIGNAL(error(QPlaceReply::Error,QString)),
this, SLOT(replyError(QPlaceReply::Error,QString)));
+
+ emit updatingChanged();
}
}
@@ -202,6 +204,11 @@ bool QDeclarativeSupportedCategoriesModel::hierarchical() const
return m_hierarchical;
}
+bool QDeclarativeSupportedCategoriesModel::updating() const
+{
+ return m_response;
+}
+
void QDeclarativeSupportedCategoriesModel::replyFinished()
{
if (!m_response)
@@ -211,6 +218,8 @@ void QDeclarativeSupportedCategoriesModel::replyFinished()
m_response = 0;
updateCategories();
+
+ emit updatingChanged();
}
void QDeclarativeSupportedCategoriesModel::replyError(QPlaceReply::Error error,
@@ -218,6 +227,10 @@ void QDeclarativeSupportedCategoriesModel::replyError(QPlaceReply::Error error,
{
Q_UNUSED(error);
Q_UNUSED(errorString);
+
+ m_response->deleteLater();
+ m_response = 0;
+ emit updatingChanged();
}
void QDeclarativeSupportedCategoriesModel::updateCategories()
diff --git a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h
index c12a4490..739ea558 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h
@@ -33,6 +33,7 @@ class QDeclarativeSupportedCategoriesModel : public QAbstractItemModel, public Q
Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged)
Q_PROPERTY(bool hierarchical READ hierarchical WRITE setHierarchical NOTIFY hierarchicalChanged)
+ Q_PROPERTY(bool updating READ updating NOTIFY updatingChanged)
Q_INTERFACES(QDeclarativeParserStatus)
@@ -64,9 +65,12 @@ public:
void setHierarchical(bool hierarchical);
bool hierarchical() const;
+ bool updating() const;
+
signals:
void pluginChanged();
void hierarchicalChanged();
+ void updatingChanged();
private slots:
void replyFinished();