From 43cc84270ffd27506287aeb96f7b1e6e72344fbb Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Fri, 28 Jun 2013 15:41:41 +0200 Subject: fix mw config issues --- sowatchui/watchesmodel.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sowatchui/watchesmodel.cpp') 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(); -- cgit v1.2.3