summaryrefslogtreecommitdiff
path: root/sowatchui/watchesmodel.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-06-28 15:41:41 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-06-28 15:41:41 +0200
commit43cc84270ffd27506287aeb96f7b1e6e72344fbb (patch)
treee361f0b269e478567641afc5c1112f121d945dca /sowatchui/watchesmodel.cpp
parent5590661cddb1a87c56fd4e95e69b00f2f2daff45 (diff)
downloadsowatch-43cc84270ffd27506287aeb96f7b1e6e72344fbb.tar.gz
sowatch-43cc84270ffd27506287aeb96f7b1e6e72344fbb.zip
fix mw config issues
Diffstat (limited to 'sowatchui/watchesmodel.cpp')
-rw-r--r--sowatchui/watchesmodel.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/sowatchui/watchesmodel.cpp b/sowatchui/watchesmodel.cpp
index 0f1fa3d..0cc162f 100644
--- a/sowatchui/watchesmodel.cpp
+++ b/sowatchui/watchesmodel.cpp
@@ -102,9 +102,23 @@ void WatchesModel::addFoundWatch(const QVariantMap &info)
}
// Set some defaults
+ const QString watchModel = info["model"].toString();
Registry *registry = Registry::registry();
+
newkey->set("providers", registry->allNotificationProviders());
- newkey->set("watchlets", registry->allWatchlets());
+
+ QStringList allWatchlets = registry->allWatchlets();
+ QStringList configuredWatchlets;
+ foreach(const QString& watchletId, allWatchlets) {
+ WatchletPluginInterface *plugin = registry->getWatchletPlugin(watchletId);
+ if (plugin) {
+ WatchletPluginInterface::WatchletInfo info = plugin->describeWatchlet(watchletId, watchModel);
+ if (info.visible) {
+ configuredWatchlets += watchletId;
+ }
+ }
+ }
+ newkey->set("watchlets", configuredWatchlets);
// Now add to the watches list
QStringList active = _watches_list->value().toStringList();