diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-06-28 15:41:41 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-06-28 15:41:41 +0200 |
commit | 43cc84270ffd27506287aeb96f7b1e6e72344fbb (patch) | |
tree | e361f0b269e478567641afc5c1112f121d945dca /sowatchui | |
parent | 5590661cddb1a87c56fd4e95e69b00f2f2daff45 (diff) | |
download | sowatch-43cc84270ffd27506287aeb96f7b1e6e72344fbb.tar.gz sowatch-43cc84270ffd27506287aeb96f7b1e6e72344fbb.zip |
fix mw config issues
Diffstat (limited to 'sowatchui')
-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(); |