diff options
Diffstat (limited to 'sowatchui/watchesmodel.cpp')
-rw-r--r-- | sowatchui/watchesmodel.cpp | 16 |
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(); |