summaryrefslogtreecommitdiff
path: root/libsowatch/declarativewatchlet.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-14 00:11:51 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-14 00:11:51 +0200
commit758cec1a767c056aaf9da36fd411cdf4a8fba32e (patch)
tree341cb8705e2e6c02d713860c8403ac8a3630a78a /libsowatch/declarativewatchlet.cpp
parent542d3489f45111aaca5514495af3847cf39e335b (diff)
downloadsowatch-758cec1a767c056aaf9da36fd411cdf4a8fba32e.tar.gz
sowatch-758cec1a767c056aaf9da36fd411cdf4a8fba32e.zip
rewrite live notifications handling using models
Diffstat (limited to 'libsowatch/declarativewatchlet.cpp')
-rw-r--r--libsowatch/declarativewatchlet.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsowatch/declarativewatchlet.cpp b/libsowatch/declarativewatchlet.cpp
index 510a68f..1851e38 100644
--- a/libsowatch/declarativewatchlet.cpp
+++ b/libsowatch/declarativewatchlet.cpp
@@ -23,7 +23,9 @@ DeclarativeWatchlet::DeclarativeWatchlet(WatchServer* server, const QString& id)
if (!_registered) {
qmlRegisterUncreatableType<DeclarativeWatchWrapper>("com.javispedro.sowatch", 1, 0,
- "Watch", "Watch is only available via the 'watch' object");
+ "Watch", "Watch is only available via the 'watch' context property");
+ qmlRegisterUncreatableType<NotificationsModel>("com.javispedro.sowatch", 1, 0,
+ "NotificationsModel", "NotificationsModel is only available via the 'notifications' context property");
qmlRegisterType<ConfigKey>();
qmlRegisterType<GConfKey>("com.javispedro.sowatch", 1, 0, "GConfKey");
_registered = true;
@@ -40,6 +42,8 @@ DeclarativeWatchlet::DeclarativeWatchlet(WatchServer* server, const QString& id)
_wrapper = new DeclarativeWatchWrapper(server, server->watch(), this);
_engine->rootContext()->setContextProperty("watch", _wrapper);
+ _engine->rootContext()->setContextProperty("notifications",
+ const_cast<NotificationsModel*>(server->notifications()));
}
DeclarativeWatchlet::~DeclarativeWatchlet()