From b6060852c4b317cd73043cdc82b652d187d952fd Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Fri, 16 Sep 2011 20:51:27 +0200 Subject: Fixing some bugs in damage tracking on real N950 --- watchlet.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'watchlet.cpp') 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(); +} -- cgit v1.2.3