summaryrefslogtreecommitdiff
path: root/watchlet.cpp
diff options
context:
space:
mode:
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();
+}