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/sysinfowatchlet.cpp | |
parent | 24c7c2f6f1429103d922ef940c0e17a3d4778059 (diff) | |
download | sowatch-49c64104c0750857858504b512955d9cc31e5c42.tar.gz sowatch-49c64104c0750857858504b512955d9cc31e5c42.zip |
update the rest of the watchlets
Diffstat (limited to 'sysinfowatchlet/sysinfowatchlet.cpp')
-rw-r--r-- | sysinfowatchlet/sysinfowatchlet.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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", "-"); } } |