summaryrefslogtreecommitdiffstats
path: root/src/Daemon/RequestHandlers
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-06-18 22:03:02 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-06-18 22:03:02 +0200
commit7234fe326d16d6bf9f4374a09ddc6ef790e6723f (patch)
tree437d4c40eeb1e9b34b369e4b82064a1572c7dac9 /src/Daemon/RequestHandlers
parentbf561f8226e97f4ace4f04bddf198175e91ee7f0 (diff)
downloadmad-7234fe326d16d6bf9f4374a09ddc6ef790e6723f.tar
mad-7234fe326d16d6bf9f4374a09ddc6ef790e6723f.zip
Globale Variablen durch Application-Klasse ersetzt
Diffstat (limited to 'src/Daemon/RequestHandlers')
-rw-r--r--src/Daemon/RequestHandlers/CommandRequestHandler.cpp4
-rw-r--r--src/Daemon/RequestHandlers/CommandRequestHandler.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp
index d00c415..ae11de5 100644
--- a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp
+++ b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp
@@ -31,9 +31,9 @@ void CommandRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlPac
std::string command = (*packet)["command"];
if(command == "reboot")
- Common::SystemManager::get()->reboot();
+ getApplication()->getSystemManager()->reboot();
else
- Common::SystemManager::get()->shutdown();
+ getApplication()->getSystemManager()->shutdown();
ret->setType("OK");
}
diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.h b/src/Daemon/RequestHandlers/CommandRequestHandler.h
index 22c7a4b..db7b3d4 100644
--- a/src/Daemon/RequestHandlers/CommandRequestHandler.h
+++ b/src/Daemon/RequestHandlers/CommandRequestHandler.h
@@ -28,10 +28,11 @@ namespace RequestHandlers {
class CommandRequestHandler : public Common::RequestHandlers::SimpleRequestHandler {
private:
- static void handleRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret);
+ void handleRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret);
public:
- CommandRequestHandler() : Common::RequestHandlers::SimpleRequestHandler("Command", &CommandRequestHandler::handleRequest) {}
+ CommandRequestHandler(Common::Application *application)
+ : Common::RequestHandlers::SimpleRequestHandler(application, "Command", boost::bind(&CommandRequestHandler::handleRequest, this, _1, _2)) {}
};
}