summaryrefslogtreecommitdiff
path: root/watchserver.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-17 03:03:23 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-17 03:03:23 +0200
commit3a755f46d9cf6e3650d40a960d0d0db8c1ad9fa1 (patch)
treef330f63caec08b6626c808b5ae70c64cab0246a6 /watchserver.cpp
parent0dca79a8c15b76ca53617c0ed3396ab6435f0152 (diff)
downloadsowatch-3a755f46d9cf6e3650d40a960d0d0db8c1ad9fa1.tar.gz
sowatch-3a755f46d9cf6e3650d40a960d0d0db8c1ad9fa1.zip
preparing for library package
Diffstat (limited to 'watchserver.cpp')
-rw-r--r--watchserver.cpp57
1 files changed, 0 insertions, 57 deletions
diff --git a/watchserver.cpp b/watchserver.cpp
deleted file mode 100644
index ad49995..0000000
--- a/watchserver.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "watch.h"
-#include "watchlet.h"
-#include "watchserver.h"
-
-using namespace sowatch;
-
-WatchServer::WatchServer(Watch* watch, QObject* parent) :
- QObject(parent), _watch(watch), _currentWatchlet(0)
-{
- connect(_watch, SIGNAL(connected()), SLOT(watchConnected()));
- connect(_watch, SIGNAL(disconnected()), SLOT(watchDisconnected()));
-}
-
-Watch* WatchServer::watch()
-{
- return _watch;
-}
-
-void WatchServer::runWatchlet(const QString& id)
-{
- if (_currentWatchlet) {
- closeWatchlet();
- }
- _currentWatchlet = watchlets[id];
- if (_watch->isConnected()) {
- _currentWatchlet->activate();
- }
-}
-
-void WatchServer::closeWatchlet()
-{
- Q_ASSERT(_currentWatchlet != 0);
- if (_watch->isConnected()) {
- _currentWatchlet->deactivate();
- }
- _currentWatchlet = 0;
-}
-
-void WatchServer::registerWatchlet(Watchlet *watchlet)
-{
- Q_ASSERT(watchlet->_server == this);
- watchlets[watchlet->id()] = watchlet;
-}
-
-void WatchServer::watchConnected()
-{
- if (_currentWatchlet) {
- _currentWatchlet->activate();
- }
-}
-
-void WatchServer::watchDisconnected()
-{
- if (_currentWatchlet) {
- _currentWatchlet->deactivate();
- }
-}