diff options
author | abcd <qt-info@nokia.com> | 2011-09-02 10:57:00 +1000 |
---|---|---|
committer | abcd <qt_abcd1@ovi.com> | 2011-09-06 09:46:34 +0200 |
commit | 1cc33bb7ef8ab997a9ffe841857a39533ba09f31 (patch) | |
tree | 22aadaceae210d1dd64ad42ffde102b0c773f419 /src/location/places/qplacemanager.cpp | |
parent | a385d5889925c3effe468fed5835f59707da92da (diff) | |
download | qtlocation-1cc33bb7ef8ab997a9ffe841857a39533ba09f31.tar.gz |
Add place add/updated/removed signals + refactor Remove
These signals indicate changes to the database. These 3 signals
are provided rather than a single placesChanged() signal because
it gives greater granularity. E.g. if a place is removed,
we may want to know precisely which one it is so we can remove
it from a model.
For the SearchResultmodel whenever a place is added, updated, or
deleted we reload the model by executing the query again.
For now in the jsondb plugin implement signal emission
manually whenever a request is finished. In a future change
we will use proper jsondb notifications.
For the online plugins, we do not expect these signals to be emitted.
Also place removal now uses the QPlaceIdReply.
Change-Id: I29f5aaaa6b8152abe1f5305a4d52abc721e6915e
Reviewed-on: http://codereview.qt.nokia.com/4109
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'src/location/places/qplacemanager.cpp')
-rw-r--r-- | src/location/places/qplacemanager.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp index b66cd111..d2f55e20 100644 --- a/src/location/places/qplacemanager.cpp +++ b/src/location/places/qplacemanager.cpp @@ -106,6 +106,13 @@ QPlaceManager::QPlaceManager(QPlaceManagerEngine *engine, QObject *parent) this, SIGNAL(error(QPlaceReply*,QPlaceReply::Error))); connect(d->engine,SIGNAL(authenticationRequired(QAuthenticator*)), this, SIGNAL(authenticationRequired(QAuthenticator*))); + + connect(d->engine, SIGNAL(placeAdded(QString)), + this, SIGNAL(placeAdded(QString)), Qt::QueuedConnection); + connect(d->engine, SIGNAL(placeUpdated(QString)), + this, SIGNAL(placeUpdated(QString)), Qt::QueuedConnection); + connect(d->engine, SIGNAL(placeRemoved(QString)), + this, SIGNAL(placeRemoved(QString)), Qt::QueuedConnection); } else { qFatal("The place manager engine that was set for this place manager was NULL."); } @@ -211,7 +218,7 @@ QPlaceIdReply *QPlaceManager::savePlace(const QGeoPlace &place, VisibilityScope /*! Removes a \a place from the manager */ -QPlaceReply *QPlaceManager::removePlace(const QGeoPlace &place) +QPlaceIdReply *QPlaceManager::removePlace(const QGeoPlace &place) { return d->engine->removePlace(place); } @@ -307,3 +314,28 @@ Use deleteLater() instead. If authentication is unsuccessful, the manager will emit the signal again. */ + +/*! + \fn void QPlaceManager::placeAdded(const QString&placeId) + + This signal is emitted if a place has been added to the manager's datastore. + + It is generally only emitted by managers that store places locally. + +*/ + +/*! + \fn void QPlaceManager::placeUpdated(const QString&placeId) + + This signal is emitted if a place has been modified in the manager's datastore. + + It is generally only emitted by managers that store places locally. +*/ + +/*! + \fn void QPlaceManager::placeRemoved(const QString&placeId) + + This signal is emitted if a place has been removed from the manager's datastore. + + It is generally only emitted by managers that store places locally. +*/ |