summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-07-19 18:39:11 (GMT)
committerTobias Markmann <tm@ayena.de>2016-07-19 18:39:11 (GMT)
commit791a5c87a7df396bc00eb8202585561b40bb8adc (patch)
tree1a7e960b84a3b6585864a19cbb7fae9e8d918152 /Swift
parent8dce1cd03729624a25a98dd2c0d026b93e452f86 (diff)
downloadswift-791a5c87a7df396bc00eb8202585561b40bb8adc.zip
swift-791a5c87a7df396bc00eb8202585561b40bb8adc.tar.bz2
Fix Swift UI sometimes getting stuck during login
In some cases during the login the helper QEventLoop in QtWebKitChatView takes over the event handling of the application and never retirms from it. Qt events are still handled in this case but any other new events are only queued up. The user would still have a responsible UI, but all network traffic or other non-Qt events would not be handled correctly. Test-Information: Without the patch Swift would get stuck during login in 5 of 10 runs. With this patch it did not get stuck anymore in 10 runs. Tested on OS X 10.11.5 with Qt 5.5.1. Change-Id: Ie17a8e01cc9c52cc784e223974ec21e604dcccab
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtWebKitChatView.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp
index aec8589..afa2d5e 100644
--- a/Swift/QtUI/QtWebKitChatView.cpp
+++ b/Swift/QtUI/QtWebKitChatView.cpp
@@ -329,11 +329,7 @@ void QtWebKitChatView::resetView() {
connect(webView_, SIGNAL(loadFinished(bool)), &syncLoop, SLOT(quit()));
webPage_->mainFrame()->setHtml(pageHTML);
while (!viewReady_) {
- QTimer t;
- t.setSingleShot(true);
- connect(&t, SIGNAL(timeout()), &syncLoop, SLOT(quit()));
- t.start(50);
- syncLoop.exec();
+ syncLoop.processEvents(QEventLoop::AllEvents, 50);
}
document_ = webPage_->mainFrame()->documentElement();