summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-02-15 21:58:18 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-02-15 21:58:18 (GMT)
commitb5bdebeeba862e6d0f541d203fed3bd0bc5cef5d (patch)
tree1bd0d9286ffbda3e197126b36b777c27b77c5e72 /Swiften
parent44bc44dee791570909b4b3d5f6f6f9f9ac07bba7 (diff)
downloadswift-contrib-b5bdebeeba862e6d0f541d203fed3bd0bc5cef5d.zip
swift-contrib-b5bdebeeba862e6d0f541d203fed3bd0bc5cef5d.tar.bz2
Moved QtEventLoop to the Swift namespace.
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/EventLoop/Qt/QtEventLoop.h56
1 files changed, 29 insertions, 27 deletions
diff --git a/Swiften/EventLoop/Qt/QtEventLoop.h b/Swiften/EventLoop/Qt/QtEventLoop.h
index b42b916..8f6c709 100644
--- a/Swiften/EventLoop/Qt/QtEventLoop.h
+++ b/Swiften/EventLoop/Qt/QtEventLoop.h
@@ -12,34 +12,36 @@
#include "Swiften/EventLoop/EventLoop.h"
-class QtEventLoop : public QObject, public Swift::EventLoop {
- public:
- QtEventLoop() {}
- ~QtEventLoop() {
- QCoreApplication::removePostedEvents(this);
- }
-
- virtual void post(const Swift::Event& event) {
- QCoreApplication::postEvent(this, new Event(event));
- }
-
- virtual bool event(QEvent* qevent) {
- Event* event = dynamic_cast<Event*>(qevent);
- if (event) {
- handleEvent(event->event_);
- //event->deleteLater(); FIXME: Leak?
- return true;
+namespace Swift {
+ class QtEventLoop : public QObject, public EventLoop {
+ public:
+ QtEventLoop() {}
+ ~QtEventLoop() {
+ QCoreApplication::removePostedEvents(this);
}
- return false;
- }
-
- private:
- struct Event : public QEvent {
- Event(const Swift::Event& event) :
- QEvent(QEvent::User), event_(event) {
+ virtual void post(const Swift::Event& event) {
+ QCoreApplication::postEvent(this, new Event(event));
+ }
+
+ virtual bool event(QEvent* qevent) {
+ Event* event = dynamic_cast<Event*>(qevent);
+ if (event) {
+ handleEvent(event->event_);
+ //event->deleteLater(); FIXME: Leak?
+ return true;
}
- Swift::Event event_;
- };
-};
+ return false;
+ }
+
+ private:
+ struct Event : public QEvent {
+ Event(const Swift::Event& event) :
+ QEvent(QEvent::User), event_(event) {
+ }
+
+ Swift::Event event_;
+ };
+ };
+}