summaryrefslogtreecommitdiff
path: root/src/messagehandler.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2012-05-04 10:46:40 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2012-05-04 10:46:40 +0200
commit3ad0a2d6f49c6f5371e8c3b0b5c502aea58aeb75 (patch)
treee9b7e4ca4d5a786abda065deb2868fe8132aec30 /src/messagehandler.cc
parentd0bd8f44997150bcb06137258512654c75e79b49 (diff)
parentde7c3ed2ccadcd179449dee6b8e38f6d7d2df3c6 (diff)
Merge branch 'master' of https://git.oftal.dk/munia
Diffstat (limited to 'src/messagehandler.cc')
-rw-r--r--src/messagehandler.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/messagehandler.cc b/src/messagehandler.cc
index 89b476a..18d5fed 100644
--- a/src/messagehandler.cc
+++ b/src/messagehandler.cc
@@ -28,10 +28,9 @@
#include "messagehandler.h"
#include "debug.h"
+// Defines global task_manager object
#include "taskmanager.h"
-TaskManager taskman;
-
MessageList handle_msg(MessageList msgList, clientid_t wsi) {
MessageList::iterator it;
@@ -44,11 +43,11 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
case cmd::add:
{
INFO(messagehandler, "Handling add command\n");
- task_t t = taskman.createTask();
+ task_t t = task_manager.createTask();
t.title = m.add.title;
t.desc = m.add.desc;
try {
- it->nodes = taskman.addTask(t, m.add.parentid);
+ it->nodes = task_manager.addTask(t, m.add.parentid);
}
catch (std::exception& e) {
DEBUG(messagehandler, "Error adding task\n");
@@ -59,7 +58,7 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
{
INFO(messagehandler, "Handling del command\n");
try {
- it->nodes = taskman.deleteTask(m.del.id);
+ it->nodes = task_manager.deleteTask(m.del.id);
}
catch (std::exception& e) {
DEBUG(messagehandler, "Error deleting task\n");
@@ -70,7 +69,7 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
{
INFO(messagehandler, "Handling move command\n");
try {
- it->nodes = taskman.moveTask(m.move.id, m.move.parentid);
+ it->nodes = task_manager.moveTask(m.move.id, m.move.parentid);
}
catch (std::exception& e) {
DEBUG(messagehandler, "Error moving task\n");
@@ -90,7 +89,7 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
task_t t;
t.title = m.update.title;
t.desc = m.update.desc;
- it->nodes = taskman.updateTask(m.update.id, t);
+ it->nodes = task_manager.updateTask(m.update.id, t);
}
catch (std::exception& e) {
DEBUG(messagehandler, "Error updating task\n");
@@ -101,7 +100,7 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
WARN(messagehandler, "!!! Unknown command\n");
break;
}
- taskman.tree.toStdOut();
+ task_manager.tree.toStdOut();
printf("%d affected nodes registered\n", m.nodes.size());
}