diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-05-05 01:55:41 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-05-05 01:55:41 +0200 |
commit | 49c64104c0750857858504b512955d9cc31e5c42 (patch) | |
tree | 1a74e10cf42f0f08b1af64e8470825e8e1c8ea41 /sysinfowatchlet | |
parent | 24c7c2f6f1429103d922ef940c0e17a3d4778059 (diff) | |
download | sowatch-49c64104c0750857858504b512955d9cc31e5c42.tar.gz sowatch-49c64104c0750857858504b512955d9cc31e5c42.zip |
update the rest of the watchlets
Diffstat (limited to 'sysinfowatchlet')
-rw-r--r-- | sysinfowatchlet/sysinfoplugin.cpp | 4 | ||||
-rw-r--r-- | sysinfowatchlet/sysinfoplugin.h | 2 | ||||
-rw-r--r-- | sysinfowatchlet/sysinfowatchlet.cpp | 16 | ||||
-rw-r--r-- | sysinfowatchlet/sysinfowatchlet.h | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/sysinfowatchlet/sysinfoplugin.cpp b/sysinfowatchlet/sysinfoplugin.cpp index 3e56307..c87e864 100644 --- a/sysinfowatchlet/sysinfoplugin.cpp +++ b/sysinfowatchlet/sysinfoplugin.cpp @@ -28,11 +28,11 @@ SysInfoPlugin::WatchletInfo SysInfoPlugin::describeWatchlet(const QString &id) return info; } -Watchlet* SysInfoPlugin::getWatchlet(const QString& id, ConfigKey *settings, WatchServer *server) +Watchlet* SysInfoPlugin::getWatchlet(const QString& id, ConfigKey *settings, Watch *watch) { Q_UNUSED(id); Q_UNUSED(settings); - return new SysInfoWatchlet(server); + return new SysInfoWatchlet(watch); } Q_EXPORT_PLUGIN2(sysinfowatchlet, SysInfoPlugin) diff --git a/sysinfowatchlet/sysinfoplugin.h b/sysinfowatchlet/sysinfoplugin.h index 8b37a1c..e22e00b 100644 --- a/sysinfowatchlet/sysinfoplugin.h +++ b/sysinfowatchlet/sysinfoplugin.h @@ -17,7 +17,7 @@ public: QStringList watchlets(); WatchletInfo describeWatchlet(const QString &id); - Watchlet* getWatchlet(const QString &id, ConfigKey *settings, WatchServer *server); + Watchlet* getWatchlet(const QString &id, ConfigKey *settings, Watch *watch); }; } diff --git a/sysinfowatchlet/sysinfowatchlet.cpp b/sysinfowatchlet/sysinfowatchlet.cpp index e159fc7..214d5de 100644 --- a/sysinfowatchlet/sysinfowatchlet.cpp +++ b/sysinfowatchlet/sysinfowatchlet.cpp @@ -5,14 +5,14 @@ using namespace sowatch; QTM_USE_NAMESPACE -SysInfoWatchlet::SysInfoWatchlet(WatchServer* server) : - DeclarativeWatchlet(server, "com.javispedro.sowatch.sysinfo"), +SysInfoWatchlet::SysInfoWatchlet(Watch* watch) : + DeclarativeWatchlet(watch, "com.javispedro.sowatch.sysinfo"), _devInfo(new QSystemDeviceInfo(this)), _netMgr(new QNetworkConfigurationManager(this)) { - rootContext()->setContextProperty("batteryLevel", 0); - rootContext()->setContextProperty("networkName", ""); - setSource(QUrl(SOWATCH_QML_DIR "/sysinfowatchlet/" + server->watch()->model() + ".qml")); + context()->setContextProperty("batteryLevel", 0); + context()->setContextProperty("networkName", ""); + setSource(QUrl(SOWATCH_QML_DIR "/sysinfowatchlet/" + watch->model() + ".qml")); connect(this, SIGNAL(activated()), SLOT(handleActivated())); connect(this, SIGNAL(deactivated()), SLOT(handleDeactivated())); } @@ -35,10 +35,10 @@ void SysInfoWatchlet::updateInformation() QList<QNetworkConfiguration> cfgs = _netMgr->allConfigurations(QNetworkConfiguration::Active); int batteryLevel = _devInfo->batteryLevel(); qDebug() << "Updating system information (batteryLevel =" << batteryLevel << "%)"; - rootContext()->setContextProperty("batteryLevel", batteryLevel); + context()->setContextProperty("batteryLevel", batteryLevel); if (cfgs.size() > 0) { - rootContext()->setContextProperty("networkName", cfgs[0].name()); + context()->setContextProperty("networkName", cfgs[0].name()); } else { - rootContext()->setContextProperty("networkName", "-"); + context()->setContextProperty("networkName", "-"); } } diff --git a/sysinfowatchlet/sysinfowatchlet.h b/sysinfowatchlet/sysinfowatchlet.h index 9ef3d7f..fe4f96f 100644 --- a/sysinfowatchlet/sysinfowatchlet.h +++ b/sysinfowatchlet/sysinfowatchlet.h @@ -14,7 +14,7 @@ class SysInfoWatchlet : public DeclarativeWatchlet { Q_OBJECT public: - explicit SysInfoWatchlet(WatchServer* server); + explicit SysInfoWatchlet(Watch* watch); private slots: void handleActivated(); |