summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-05 01:55:41 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-05 01:55:41 +0200
commit49c64104c0750857858504b512955d9cc31e5c42 (patch)
tree1a74e10cf42f0f08b1af64e8470825e8e1c8ea41
parent24c7c2f6f1429103d922ef940c0e17a3d4778059 (diff)
downloadsowatch-49c64104c0750857858504b512955d9cc31e5c42.tar.gz
sowatch-49c64104c0750857858504b512955d9cc31e5c42.zip
update the rest of the watchlets
-rw-r--r--libsowatch/declarativewatchlet.cpp9
-rw-r--r--libsowatch/declarativewatchlet.h3
-rw-r--r--nekowatchlet/nekowatchlet.cpp6
-rw-r--r--nekowatchlet/nekowatchlet.h2
-rw-r--r--nekowatchlet/nekowatchletplugin.cpp4
-rw-r--r--nekowatchlet/nekowatchletplugin.h2
-rw-r--r--qmafwwatchlet/qmafwwatchlet.cpp6
-rw-r--r--qmafwwatchlet/qmafwwatchlet.h2
-rw-r--r--qmapwatchlet/compasswatchlet.cpp6
-rw-r--r--qmapwatchlet/compasswatchlet.h2
-rw-r--r--qmapwatchlet/qmapwatchlet.cpp6
-rw-r--r--qmapwatchlet/qmapwatchlet.h2
-rw-r--r--qmapwatchlet/qmapwatchletplugin.cpp6
-rw-r--r--qmapwatchlet/qmapwatchletplugin.h2
-rw-r--r--qmsgwatchlet/qmsgwatchlet.cpp6
-rw-r--r--qmsgwatchlet/qmsgwatchlet.h2
-rw-r--r--qmsgwatchlet/qmsgwatchletplugin.cpp4
-rw-r--r--qmsgwatchlet/qmsgwatchletplugin.h2
-rw-r--r--qorgwatchlet/qorgwatchlet.cpp6
-rw-r--r--qorgwatchlet/qorgwatchlet.h2
-rw-r--r--qorgwatchlet/qorgwatchletplugin.cpp4
-rw-r--r--qorgwatchlet/qorgwatchletplugin.h2
-rw-r--r--sysinfowatchlet/sysinfoplugin.cpp4
-rw-r--r--sysinfowatchlet/sysinfoplugin.h2
-rw-r--r--sysinfowatchlet/sysinfowatchlet.cpp16
-rw-r--r--sysinfowatchlet/sysinfowatchlet.h2
26 files changed, 52 insertions, 58 deletions
diff --git a/libsowatch/declarativewatchlet.cpp b/libsowatch/declarativewatchlet.cpp
index ed6ec26..3647575 100644
--- a/libsowatch/declarativewatchlet.cpp
+++ b/libsowatch/declarativewatchlet.cpp
@@ -84,14 +84,9 @@ void DeclarativeWatchlet::setSource(const QUrl &url)
}
}
-QDeclarativeEngine* DeclarativeWatchlet::engine()
+QDeclarativeContext* DeclarativeWatchlet::context()
{
- return _engine;
-}
-
-QDeclarativeContext* DeclarativeWatchlet::rootContext()
-{
- return _engine->rootContext();
+ return _context;
}
QDeclarativeItem* DeclarativeWatchlet::rootObject()
diff --git a/libsowatch/declarativewatchlet.h b/libsowatch/declarativewatchlet.h
index 6433880..cf2fd39 100644
--- a/libsowatch/declarativewatchlet.h
+++ b/libsowatch/declarativewatchlet.h
@@ -22,8 +22,7 @@ public:
void setSource(const QUrl& url);
- QDeclarativeEngine* engine();
- QDeclarativeContext* rootContext();
+ QDeclarativeContext* context();
QDeclarativeItem* rootObject();
void activate();
diff --git a/nekowatchlet/nekowatchlet.cpp b/nekowatchlet/nekowatchlet.cpp
index 627d127..6c02bee 100644
--- a/nekowatchlet/nekowatchlet.cpp
+++ b/nekowatchlet/nekowatchlet.cpp
@@ -4,14 +4,14 @@ using namespace sowatch;
const QLatin1String NekoWatchlet::myId("com.javispedro.sowatch.neko");
-NekoWatchlet::NekoWatchlet(WatchServer* server) :
- DeclarativeWatchlet(server, myId)
+NekoWatchlet::NekoWatchlet(Watch* watch) :
+ DeclarativeWatchlet(watch, myId)
{
// Workaround Qt's stupid clip region calculation when
// - There's a QML item with clip = true
// - And we are using "compat" updateRects() signal mode
setFullUpdateMode(true);
- setSource(QUrl(SOWATCH_QML_DIR "/nekowatchlet/" + server->watch()->model() + ".qml"));
+ setSource(QUrl(SOWATCH_QML_DIR "/nekowatchlet/" + watch->model() + ".qml"));
}
diff --git a/nekowatchlet/nekowatchlet.h b/nekowatchlet/nekowatchlet.h
index 067606a..0294952 100644
--- a/nekowatchlet/nekowatchlet.h
+++ b/nekowatchlet/nekowatchlet.h
@@ -10,7 +10,7 @@ class NekoWatchlet : public DeclarativeWatchlet
{
Q_OBJECT
public:
- explicit NekoWatchlet(WatchServer* server);
+ explicit NekoWatchlet(Watch* watch);
static const QLatin1String myId;
};
diff --git a/nekowatchlet/nekowatchletplugin.cpp b/nekowatchlet/nekowatchletplugin.cpp
index c891530..aee7923 100644
--- a/nekowatchlet/nekowatchletplugin.cpp
+++ b/nekowatchlet/nekowatchletplugin.cpp
@@ -28,11 +28,11 @@ WatchletPluginInterface::WatchletInfo NekoWatchletPlugin::describeWatchlet(const
return info;
}
-Watchlet* NekoWatchletPlugin::getWatchlet(const QString& driver, ConfigKey *settings, WatchServer *server)
+Watchlet* NekoWatchletPlugin::getWatchlet(const QString& driver, ConfigKey *settings, Watch *watch)
{
Q_UNUSED(driver);
Q_UNUSED(settings);
- return new NekoWatchlet(server);
+ return new NekoWatchlet(watch);
}
Q_EXPORT_PLUGIN2(notificationswatchlet, NekoWatchletPlugin)
diff --git a/nekowatchlet/nekowatchletplugin.h b/nekowatchlet/nekowatchletplugin.h
index f7f1bdf..b03df53 100644
--- a/nekowatchlet/nekowatchletplugin.h
+++ b/nekowatchlet/nekowatchletplugin.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/qmafwwatchlet/qmafwwatchlet.cpp b/qmafwwatchlet/qmafwwatchlet.cpp
index 84c5ea9..41cea2a 100644
--- a/qmafwwatchlet/qmafwwatchlet.cpp
+++ b/qmafwwatchlet/qmafwwatchlet.cpp
@@ -6,7 +6,7 @@
using namespace sowatch;
-QMafwWatchlet::QMafwWatchlet(WatchServer* server) :
+QMafwWatchlet::QMafwWatchlet(Watch* watch) :
DeclarativeWatchlet(server, "com.javispedro.sowatch.qmafw"),
_registry(MafwRegistry::instance()),
_player(new QMafwWatchletPlayer(this)),
@@ -22,8 +22,8 @@ QMafwWatchlet::QMafwWatchlet(WatchServer* server) :
connect(this, SIGNAL(activated()), _player, SLOT(activate()));
connect(this, SIGNAL(deactivated()), _player, SLOT(deactivate()));
- rootContext()->setContextProperty("player", _player);
- rootContext()->setContextProperty("volumeControl", _volumeControl);
+ context()->setContextProperty("player", _player);
+ context()->setContextProperty("volumeControl", _volumeControl);
setSource(QUrl(SOWATCH_QML_DIR "/qmafwwatchlet/" + server->watch()->model() + ".qml"));
}
diff --git a/qmafwwatchlet/qmafwwatchlet.h b/qmafwwatchlet/qmafwwatchlet.h
index 09cdf81..afec03a 100644
--- a/qmafwwatchlet/qmafwwatchlet.h
+++ b/qmafwwatchlet/qmafwwatchlet.h
@@ -15,7 +15,7 @@ class QMafwWatchlet : public DeclarativeWatchlet
{
Q_OBJECT
public:
- explicit QMafwWatchlet(WatchServer* server);
+ explicit QMafwWatchlet(Watch* watch);
private:
MafwRegistry *_registry;
diff --git a/qmapwatchlet/compasswatchlet.cpp b/qmapwatchlet/compasswatchlet.cpp
index cbc19a4..2ebfc42 100644
--- a/qmapwatchlet/compasswatchlet.cpp
+++ b/qmapwatchlet/compasswatchlet.cpp
@@ -4,8 +4,8 @@ using namespace sowatch;
const QLatin1String CompassWatchlet::myId("com.javispedro.sowatch.compass");
-CompassWatchlet::CompassWatchlet(WatchServer* server) :
- DeclarativeWatchlet(server, myId)
+CompassWatchlet::CompassWatchlet(Watch* watch) :
+ DeclarativeWatchlet(watch, myId)
{
- setSource(QUrl(SOWATCH_QML_DIR "/qmapwatchlet/compass-" + server->watch()->model() + ".qml"));
+ setSource(QUrl(SOWATCH_QML_DIR "/qmapwatchlet/compass-" + watch->model() + ".qml"));
}
diff --git a/qmapwatchlet/compasswatchlet.h b/qmapwatchlet/compasswatchlet.h
index 88547a2..3663c18 100644
--- a/qmapwatchlet/compasswatchlet.h
+++ b/qmapwatchlet/compasswatchlet.h
@@ -10,7 +10,7 @@ class CompassWatchlet : public DeclarativeWatchlet
{
Q_OBJECT
public:
- explicit CompassWatchlet(WatchServer* server);
+ explicit CompassWatchlet(Watch* watch);
static const QLatin1String myId;
};
diff --git a/qmapwatchlet/qmapwatchlet.cpp b/qmapwatchlet/qmapwatchlet.cpp
index d262c2c..28fa6fa 100644
--- a/qmapwatchlet/qmapwatchlet.cpp
+++ b/qmapwatchlet/qmapwatchlet.cpp
@@ -4,9 +4,9 @@ using namespace sowatch;
const QLatin1String QMapWatchlet::myId("com.javispedro.sowatch.qmap");
-QMapWatchlet::QMapWatchlet(WatchServer* server) :
- DeclarativeWatchlet(server, myId)
+QMapWatchlet::QMapWatchlet(Watch* watch) :
+ DeclarativeWatchlet(watch, myId)
{
setFullUpdateMode(true);
- setSource(QUrl(SOWATCH_QML_DIR "/qmapwatchlet/map-" + server->watch()->model() + ".qml"));
+ setSource(QUrl(SOWATCH_QML_DIR "/qmapwatchlet/map-" + watch->model() + ".qml"));
}
diff --git a/qmapwatchlet/qmapwatchlet.h b/qmapwatchlet/qmapwatchlet.h
index 8683aae..168368f 100644
--- a/qmapwatchlet/qmapwatchlet.h
+++ b/qmapwatchlet/qmapwatchlet.h
@@ -10,7 +10,7 @@ class QMapWatchlet : public DeclarativeWatchlet
{
Q_OBJECT
public:
- explicit QMapWatchlet(WatchServer* server);
+ explicit QMapWatchlet(Watch* watch);
static const QLatin1String myId;
};
diff --git a/qmapwatchlet/qmapwatchletplugin.cpp b/qmapwatchlet/qmapwatchletplugin.cpp
index 8f48539..b34606f 100644
--- a/qmapwatchlet/qmapwatchletplugin.cpp
+++ b/qmapwatchlet/qmapwatchletplugin.cpp
@@ -48,13 +48,13 @@ WatchletPluginInterface::WatchletInfo QMapWatchletPlugin::describeWatchlet(const
return info;
}
-Watchlet* QMapWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, WatchServer *server)
+Watchlet* QMapWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, Watch *watch)
{
Q_UNUSED(config);
if (id == QMapWatchlet::myId) {
- return new QMapWatchlet(server);
+ return new QMapWatchlet(watch);
} else if (id == CompassWatchlet::myId) {
- return new CompassWatchlet(server);
+ return new CompassWatchlet(watch);
}
return 0;
}
diff --git a/qmapwatchlet/qmapwatchletplugin.h b/qmapwatchlet/qmapwatchletplugin.h
index 3d10213..a6f494a 100644
--- a/qmapwatchlet/qmapwatchletplugin.h
+++ b/qmapwatchlet/qmapwatchletplugin.h
@@ -18,7 +18,7 @@ public:
QStringList watchlets();
WatchletInfo describeWatchlet(const QString &id);
- Watchlet* getWatchlet(const QString &id, ConfigKey *config, WatchServer *server);
+ Watchlet* getWatchlet(const QString &id, ConfigKey *config, Watch *watch);
static QtMobility::QGeoServiceProvider * geoServiceProvider();
diff --git a/qmsgwatchlet/qmsgwatchlet.cpp b/qmsgwatchlet/qmsgwatchlet.cpp
index 7111c81..6a24ab9 100644
--- a/qmsgwatchlet/qmsgwatchlet.cpp
+++ b/qmsgwatchlet/qmsgwatchlet.cpp
@@ -5,9 +5,9 @@
QTM_USE_NAMESPACE
using namespace sowatch;
-QMsgWatchlet::QMsgWatchlet(WatchServer* server) :
- DeclarativeWatchlet(server, "com.javispedro.sowatch.qmsg"),
+QMsgWatchlet::QMsgWatchlet(Watch* watch) :
+ DeclarativeWatchlet(watch, "com.javispedro.sowatch.qmsg"),
_qms(new QMessageService(this))
{
- setSource(QUrl(SOWATCH_QML_DIR "/qmsgwatchlet/" + server->watch()->model() + ".qml"));
+ setSource(QUrl(SOWATCH_QML_DIR "/qmsgwatchlet/" + watch->model() + ".qml"));
}
diff --git a/qmsgwatchlet/qmsgwatchlet.h b/qmsgwatchlet/qmsgwatchlet.h
index 6fa331c..b698d21 100644
--- a/qmsgwatchlet/qmsgwatchlet.h
+++ b/qmsgwatchlet/qmsgwatchlet.h
@@ -11,7 +11,7 @@ class QMsgWatchlet : public DeclarativeWatchlet
{
Q_OBJECT
public:
- explicit QMsgWatchlet(WatchServer* server);
+ explicit QMsgWatchlet(Watch* watch);
private:
QtMobility::QMessageService *_qms;
diff --git a/qmsgwatchlet/qmsgwatchletplugin.cpp b/qmsgwatchlet/qmsgwatchletplugin.cpp
index dfabd12..91c6387 100644
--- a/qmsgwatchlet/qmsgwatchletplugin.cpp
+++ b/qmsgwatchlet/qmsgwatchletplugin.cpp
@@ -32,11 +32,11 @@ WatchletPluginInterface::WatchletInfo QMsgWatchletPlugin::describeWatchlet(const
return info;
}
-Watchlet* QMsgWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, WatchServer *server)
+Watchlet* QMsgWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, Watch *watch)
{
Q_UNUSED(config);
if (id != "com.javispedro.sowatch.qmsg") return 0;
- return new QMsgWatchlet(server);
+ return new QMsgWatchlet(watch);
}
Q_EXPORT_PLUGIN2(qmsgwatchlet, QMsgWatchletPlugin)
diff --git a/qmsgwatchlet/qmsgwatchletplugin.h b/qmsgwatchlet/qmsgwatchletplugin.h
index 01cb83e..728ed0b 100644
--- a/qmsgwatchlet/qmsgwatchletplugin.h
+++ b/qmsgwatchlet/qmsgwatchletplugin.h
@@ -17,7 +17,7 @@ public:
QStringList watchlets();
WatchletInfo describeWatchlet(const QString &id);
- Watchlet* getWatchlet(const QString &id, ConfigKey *config, WatchServer *server);
+ Watchlet* getWatchlet(const QString &id, ConfigKey *config, Watch *watch);
};
}
diff --git a/qorgwatchlet/qorgwatchlet.cpp b/qorgwatchlet/qorgwatchlet.cpp
index 3d042fb..5911a9b 100644
--- a/qorgwatchlet/qorgwatchlet.cpp
+++ b/qorgwatchlet/qorgwatchlet.cpp
@@ -4,8 +4,8 @@
using namespace sowatch;
-QOrgWatchlet::QOrgWatchlet(WatchServer* server) :
- DeclarativeWatchlet(server, "com.javispedro.sowatch.qorg")
+QOrgWatchlet::QOrgWatchlet(Watch* watch) :
+ DeclarativeWatchlet(watch, "com.javispedro.sowatch.qorg")
{
- setSource(QUrl(SOWATCH_QML_DIR "/qorgwatchlet/" + server->watch()->model() + ".qml"));
+ setSource(QUrl(SOWATCH_QML_DIR "/qorgwatchlet/" + watch->model() + ".qml"));
}
diff --git a/qorgwatchlet/qorgwatchlet.h b/qorgwatchlet/qorgwatchlet.h
index 1c0f28e..517c4b3 100644
--- a/qorgwatchlet/qorgwatchlet.h
+++ b/qorgwatchlet/qorgwatchlet.h
@@ -10,7 +10,7 @@ class QOrgWatchlet : public DeclarativeWatchlet
{
Q_OBJECT
public:
- explicit QOrgWatchlet(WatchServer* server);
+ explicit QOrgWatchlet(Watch* watch);
};
}
diff --git a/qorgwatchlet/qorgwatchletplugin.cpp b/qorgwatchlet/qorgwatchletplugin.cpp
index 4b7bb47..8416f0f 100644
--- a/qorgwatchlet/qorgwatchletplugin.cpp
+++ b/qorgwatchlet/qorgwatchletplugin.cpp
@@ -33,11 +33,11 @@ WatchletPluginInterface::WatchletInfo QOrgWatchletPlugin::describeWatchlet(const
return info;
}
-Watchlet* QOrgWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, WatchServer *server)
+Watchlet* QOrgWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, Watch *watch)
{
Q_UNUSED(config);
if (id != "com.javispedro.sowatch.qorg") return 0;
- return new QOrgWatchlet(server);
+ return new QOrgWatchlet(watch);
}
Q_EXPORT_PLUGIN2(qmsgwatchlet, QOrgWatchletPlugin)
diff --git a/qorgwatchlet/qorgwatchletplugin.h b/qorgwatchlet/qorgwatchletplugin.h
index dddbce2..9f4d3d5 100644
--- a/qorgwatchlet/qorgwatchletplugin.h
+++ b/qorgwatchlet/qorgwatchletplugin.h
@@ -17,7 +17,7 @@ public:
QStringList watchlets();
WatchletInfo describeWatchlet(const QString &id);
- Watchlet* getWatchlet(const QString &id, ConfigKey *config, WatchServer *server);
+ Watchlet* getWatchlet(const QString &id, ConfigKey *config, Watch *watch);
};
}
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();