summaryrefslogtreecommitdiffstats
path: root/src/imports/serviceframework/qdeclarativeservice_p.h
diff options
context:
space:
mode:
authorAndrew Stanley-Jones <andrew.stanley-jones@nokia.com>2011-11-14 17:59:54 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-14 09:11:23 +0100
commitc006db1e3c8a1801f243cc1e547d252152a6e643 (patch)
treeae363fe7a04f926138364941d419413db78c3f85 /src/imports/serviceframework/qdeclarativeservice_p.h
parent2a51ff02afdd5dacaa15f6ec12e03f3755db4b67 (diff)
Add dynamic updates to the ServiceList object
This allows the ServiceList object to listen for notifications from the database for updates instead of polling for changes. Change-Id: If2e7b8ff3a235be18aa4e47a5b4cf30754a5959b Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com> Sanity-Review: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
Diffstat (limited to 'src/imports/serviceframework/qdeclarativeservice_p.h')
-rw-r--r--src/imports/serviceframework/qdeclarativeservice_p.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/imports/serviceframework/qdeclarativeservice_p.h b/src/imports/serviceframework/qdeclarativeservice_p.h
index 725546e1..60230f42 100644
--- a/src/imports/serviceframework/qdeclarativeservice_p.h
+++ b/src/imports/serviceframework/qdeclarativeservice_p.h
@@ -125,6 +125,7 @@ class QDeclarativeServiceList : public QObject, public QDeclarativeParserStatus
Q_PROPERTY(QString interfaceName READ interfaceName WRITE setInterfaceName NOTIFY interfaceNameChanged)
Q_PROPERTY(int majorVersion READ majorVersion WRITE setMajorVersion NOTIFY majorVersionChanged)
Q_PROPERTY(int minorVersion READ minorVersion WRITE setMinorVersion NOTIFY minorVersionChanged)
+ Q_PROPERTY(bool dynamicUpdates READ dynamicUpdates WRITE setDynamicUpdates NOTIFY dynamicUpdatesChanged)
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeService> services READ services NOTIFY resultsChanged)
Q_PROPERTY(MatchRule versionMatch READ versionMatch WRITE setVersionMatch NOTIFY versionMatchChanged)
@@ -153,6 +154,9 @@ public:
void setMajorVersion(int major);
int majorVersion() const;
+ void setDynamicUpdates(bool updates);
+ bool dynamicUpdates() const;
+
void setVersionMatch(QDeclarativeServiceList::MatchRule match);
QDeclarativeServiceList::MatchRule versionMatch() const;
@@ -170,9 +174,15 @@ Q_SIGNALS:
void minorVersionChanged();
void majorVersionChanged();
void versionMatchChanged();
+ void dynamicUpdatesChanged();
+
+protected slots:
+ void servicesAddedRemoved();
+ void updateFilterResults();
private:
QList<QDeclarativeService *> m_services;
+ QList<QServiceInterfaceDescriptor> m_currentList;
QServiceManager* serviceManager;
QString m_service;
QString m_interface;
@@ -180,8 +190,7 @@ private:
int m_minor;
QDeclarativeServiceList::MatchRule m_match;
bool m_componentComplete;
-
- void updateFilterResults();
+ bool m_dynamicUpdates;
static void s_append(QDeclarativeListProperty<QDeclarativeService> *prop, QDeclarativeService *service);
static int s_count(QDeclarativeListProperty<QDeclarativeService> *prop);