summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/EventLoop/DummyEventLoop.cpp')
-rw-r--r--Swiften/EventLoop/DummyEventLoop.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/Swiften/EventLoop/DummyEventLoop.cpp b/Swiften/EventLoop/DummyEventLoop.cpp
index 3741eec..234ba7a 100644
--- a/Swiften/EventLoop/DummyEventLoop.cpp
+++ b/Swiften/EventLoop/DummyEventLoop.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2019 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/EventLoop/DummyEventLoop.h>
-#include <iostream>
+#include <Swiften/Base/Log.h>
namespace Swift {
@@ -14,11 +14,24 @@ DummyEventLoop::DummyEventLoop() {
}
DummyEventLoop::~DummyEventLoop() {
- if (!events_.empty()) {
- std::cerr << "DummyEventLoop: Unhandled events at destruction time" << std::endl;
- }
- events_.clear();
+ if (hasEvents()) {
+ SWIFT_LOG(warning) << "DummyEventLoop: Unhandled events at destruction time";
+ }
}
+void DummyEventLoop::processEvents() {
+ while(hasEvents()) {
+ hasEvents_ = false;
+ handleNextEvent();
+ }
+}
+
+bool DummyEventLoop::hasEvents() {
+ return hasEvents_;
+}
+
+void DummyEventLoop::eventPosted() {
+ hasEvents_ = true;
+}
}