diff options
author | Jamey Hicks <jamey.hicks@nokia.com> | 2012-02-28 09:57:26 -0500 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-16 17:39:22 +0100 |
commit | 6d12917862ee99ce05331d4b6ab481a3cd3a0b04 (patch) | |
tree | 1846d44d231bc3d3469f255f76c8f076f3b1fb8c /src/daemon/jsondbnotification.cpp | |
parent | eb6d35295b596445f7ece3f653b6415525dc6fe2 (diff) |
Add support for old notifications to QJsonDbWatcher
Example, assuming stateNumber 2962 is in the recent past:
QtJsonDb::QJsonDbWatcher *watcher = new QtJsonDb::QJsonDbWatcher;
watcher->setQuery(QStringLiteral("[?_type=\"Foo\"]"));
watcher->setInitialStateNumber(2962);
connection->addWatcher(watcher);
...
QList<QJsonDbNotification> event = watcher->takeNotifications();
If stateNumber is 0xFFFFFFFF, then sends a "create" notification for
every object currently in the specified partition. Applications can
use this to find all matching objects and all changes to those objects
going forward.
Fixes Bug #7276.
Also fixes Bug #7300.
Change-Id: Icd01d05f89c8480804ea8ef09061022f107091f1
Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
Diffstat (limited to 'src/daemon/jsondbnotification.cpp')
-rw-r--r-- | src/daemon/jsondbnotification.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/daemon/jsondbnotification.cpp b/src/daemon/jsondbnotification.cpp index 02b32623..3fb12d4e 100644 --- a/src/daemon/jsondbnotification.cpp +++ b/src/daemon/jsondbnotification.cpp @@ -59,6 +59,7 @@ JsonDbNotification::JsonDbNotification(const JsonDbOwner *owner, const QString & , mQuery(query) , mActions(None) , mPartition(partition) + , mInitialStateNumber(0) { foreach (QString s, actions) { if (s == JsonDbString::kCreateStr) |