summaryrefslogtreecommitdiff
path: root/watchlet.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-16 20:51:27 +0200
committerJavier <javier@pcjavier.(none)>2011-09-16 20:51:27 +0200
commitb6060852c4b317cd73043cdc82b652d187d952fd (patch)
treea5795eb33379e7172cd16962c131b8bac8db16da /watchlet.cpp
parentaa1c0fd3146b4ed055d181c99d52463afa6bedbb (diff)
downloadsowatch-b6060852c4b317cd73043cdc82b652d187d952fd.tar.gz
sowatch-b6060852c4b317cd73043cdc82b652d187d952fd.zip
Fixing some bugs in damage tracking on real N950
Diffstat (limited to 'watchlet.cpp')
-rw-r--r--watchlet.cpp23
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();
+}