summaryrefslogtreecommitdiff
path: root/sowatchui/watchesmodel.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-09 18:50:23 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-09 18:50:23 +0200
commitbc5b70046e84c6e5a33a19bd2e64e626fdf0579e (patch)
tree49452d6add3626d527b19298acd1587de167350b /sowatchui/watchesmodel.cpp
parentc7c6a2c596637fd4942c7fb80341ca2ef7b47808 (diff)
downloadsowatch-bc5b70046e84c6e5a33a19bd2e64e626fdf0579e.tar.gz
sowatch-bc5b70046e84c6e5a33a19bd2e64e626fdf0579e.zip
first UI editable settings!
Diffstat (limited to 'sowatchui/watchesmodel.cpp')
-rw-r--r--sowatchui/watchesmodel.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/sowatchui/watchesmodel.cpp b/sowatchui/watchesmodel.cpp
index 5644466..c45a229 100644
--- a/sowatchui/watchesmodel.cpp
+++ b/sowatchui/watchesmodel.cpp
@@ -14,6 +14,8 @@ WatchesModel::WatchesModel(QObject *parent) :
roles[Qt::DisplayRole] = QByteArray("title");
roles[Qt::StatusTipRole] = QByteArray("subtitle");
roles[ObjectRole] = QByteArray("object");
+ roles[ConfigKeyRole] = QByteArray("configKey");
+ roles[ConfigQmlUrlRole] = QByteArray("configQmlUrl");
setRoleNames(roles);
connect(_config, SIGNAL(changed()),
@@ -57,6 +59,17 @@ QVariant WatchesModel::data(const QModelIndex &index, int role) const
} else {
return QVariant(tr("Disabled"));
}
+ case ConfigKeyRole:
+ return QVariant::fromValue(key);
+ case ConfigQmlUrlRole:
+ if (config->isSet("driver")) {
+ QString driver = config->value("driver").toString();
+ WatchPluginInterface *plugin = Registry::registry()->getWatchPlugin(driver);
+ if (plugin) {
+ return QVariant::fromValue(plugin->getConfigQmlUrl(driver));
+ }
+ }
+ return QVariant::fromValue(QUrl());
}
return QVariant();
}