summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-27 19:06:56 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-27 19:07:55 (GMT)
commit6810a2896f27e7ee07aee847f5e8dbccd1f6ec89 (patch)
treef7ea87f030e57cb4494a4f897506fb18fc3d2241 /Swiften/Network/BoostTimer.cpp
parenta7da393cfc807048d320ddba8a1c7d24ef23a46e (diff)
downloadswift-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.zip
swift-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.tar.bz2
Remove MainEventLoop singleton.
The event loop now needs to be explicitly passed to clients using it.
Diffstat (limited to 'Swiften/Network/BoostTimer.cpp')
-rw-r--r--Swiften/Network/BoostTimer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Network/BoostTimer.cpp b/Swiften/Network/BoostTimer.cpp
index c655860..65e7712 100644
--- a/Swiften/Network/BoostTimer.cpp
+++ b/Swiften/Network/BoostTimer.cpp
@@ -9,12 +9,12 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/asio.hpp>
-#include "Swiften/EventLoop/MainEventLoop.h"
+#include "Swiften/EventLoop/EventLoop.h"
namespace Swift {
-BoostTimer::BoostTimer(int milliseconds, boost::asio::io_service* service) :
- timeout(milliseconds), timer(*service) {
+BoostTimer::BoostTimer(int milliseconds, boost::asio::io_service* service, EventLoop* eventLoop) :
+ timeout(milliseconds), timer(*service), eventLoop(eventLoop) {
}
void BoostTimer::start() {
@@ -31,7 +31,7 @@ void BoostTimer::handleTimerTick(const boost::system::error_code& error) {
assert(error == boost::asio::error::operation_aborted);
}
else {
- MainEventLoop::postEvent(boost::bind(boost::ref(onTick)), shared_from_this());
+ eventLoop->postEvent(boost::bind(boost::ref(onTick)), shared_from_this());
timer.expires_from_now(boost::posix_time::milliseconds(timeout));
timer.async_wait(boost::bind(&BoostTimer::handleTimerTick, shared_from_this(), boost::asio::placeholders::error));
}