diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2011-09-16 20:51:27 +0200 |
---|---|---|
committer | Javier <javier@pcjavier.(none)> | 2011-09-16 20:51:27 +0200 |
commit | b6060852c4b317cd73043cdc82b652d187d952fd (patch) | |
tree | a5795eb33379e7172cd16962c131b8bac8db16da /watchlet.cpp | |
parent | aa1c0fd3146b4ed055d181c99d52463afa6bedbb (diff) | |
download | sowatch-b6060852c4b317cd73043cdc82b652d187d952fd.tar.gz sowatch-b6060852c4b317cd73043cdc82b652d187d952fd.zip |
Fixing some bugs in damage tracking on real N950
Diffstat (limited to 'watchlet.cpp')
-rw-r--r-- | watchlet.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/watchlet.cpp b/watchlet.cpp index 2e76d5e..6d7fe68 100644 --- a/watchlet.cpp +++ b/watchlet.cpp @@ -4,7 +4,7 @@ using namespace sowatch; Watchlet::Watchlet(WatchServer *server, const QString& id) : - QObject(server), _id(id), _server(server) + QObject(server), _id(id), _active(false), _server(server) { _server->registerWatchlet(this); } @@ -19,7 +19,26 @@ Watch* Watchlet::watch() return _server->watch(); } -QString Watchlet::id() +QString Watchlet::id() const { return _id; } + +bool Watchlet::isActive() const +{ + return _active; +} + +void Watchlet::activate() +{ + _active = true; + emit activeChanged(); + emit activated(); +} + +void Watchlet::deactivate() +{ + _active = false; + emit activeChanged(); + emit deactivated(); +} |