summaryrefslogtreecommitdiff
path: root/libsowatch
diff options
context:
space:
mode:
Diffstat (limited to 'libsowatch')
-rw-r--r--libsowatch/watchserver.cpp12
-rw-r--r--libsowatch/watchserver.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/libsowatch/watchserver.cpp b/libsowatch/watchserver.cpp
index 01af063..511c2c5 100644
--- a/libsowatch/watchserver.cpp
+++ b/libsowatch/watchserver.cpp
@@ -71,6 +71,18 @@ void WatchServer::insertWatchlet(int position, Watchlet *watchlet)
_watchletIds[id] = watchlet;
}
+void WatchServer::moveWatchlet(const Watchlet *watchlet, int to)
+{
+ const QString id = watchlet->id();
+ int index = _watchlets.indexOf(const_cast<Watchlet*>(watchlet));
+
+ Q_ASSERT(watchlet->_server == this);
+ Q_ASSERT(_watchletIds.contains(id));
+ Q_ASSERT(index >= 0);
+
+ _watchlets.move(index, to);
+}
+
void WatchServer::removeWatchlet(const Watchlet *watchlet)
{
const QString id = watchlet->id();
diff --git a/libsowatch/watchserver.h b/libsowatch/watchserver.h
index 91f9b4e..67fcb81 100644
--- a/libsowatch/watchserver.h
+++ b/libsowatch/watchserver.h
@@ -35,6 +35,7 @@ public:
void addWatchlet(Watchlet *watchlet);
void insertWatchlet(int position, Watchlet *watchlet);
+ void moveWatchlet(const Watchlet *watchlet, int to);
void removeWatchlet(const Watchlet *watchlet);
void addProvider(NotificationProvider *provider);