From d194a6112299cfe045c34e5cdb6adbbb81418d09 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Fri, 10 Aug 2012 00:45:24 +0200 Subject: new watchhandler for watchlet/prov lifecycle mgmt --- sowatchui/sowatchui.pro | 4 ++-- sowatchui/watchesmodel.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'sowatchui') diff --git a/sowatchui/sowatchui.pro b/sowatchui/sowatchui.pro index 9caa163..c0589fc 100644 --- a/sowatchui/sowatchui.pro +++ b/sowatchui/sowatchui.pro @@ -10,9 +10,9 @@ DEPLOYMENTFOLDERS = qml_folder # Install icon files also to resources directory res_files.files += sowatch64.png sowatch80.png !isEmpty(MEEGO_VERSION_MAJOR)|maemo5 { - res_files.path = /opt/sowatch/share/metawatch + res_files.path = /opt/sowatch/share } else { - res_files.path = /usr/share/sowatch/metawatch + res_files.path = /usr/share/sowatch } INSTALLS += res_files diff --git a/sowatchui/watchesmodel.cpp b/sowatchui/watchesmodel.cpp index 0930715..302e484 100644 --- a/sowatchui/watchesmodel.cpp +++ b/sowatchui/watchesmodel.cpp @@ -12,6 +12,7 @@ WatchesModel::WatchesModel(QObject *parent) : { QHash roles = roleNames(); roles[Qt::DisplayRole] = QByteArray("title"); + roles[Qt::DecorationRole] = QByteArray("iconSource"); roles[Qt::StatusTipRole] = QByteArray("subtitle"); roles[EnabledRole] = QByteArray("enabled"); roles[ConfigKeyRole] = QByteArray("configKey"); @@ -44,6 +45,12 @@ QVariant WatchesModel::data(const QModelIndex &index, int role) const switch (role) { case Qt::DisplayRole: return config->value("name"); + case Qt::DecorationRole: +#if defined(QT_DEBUG) + return QVariant(QDir::current().absoluteFilePath(SOWATCH_RESOURCES_DIR "/sowatch64.png")); +#else + return QVariant(SOWATCH_RESOURCES_DIR "/sowatch64.png"); +#endif case Qt::StatusTipRole: if (config->value("enable").toBool()) { QString status = _status[id]; -- cgit v1.2.3