summaryrefslogtreecommitdiff
path: root/sowatchui/watchesmodel.cpp
diff options
context:
space:
mode:
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();
}