aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/widgets/loadingbar.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-01-31 12:30:51 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-01-31 12:30:51 +0100
commitd1635b36d00b7239cbebcf9f78e9c8615ac1d7d5 (patch)
tree31525586e8e1fa89093b10b0d88924a27e1c2241 /src/mainwindow/widgets/loadingbar.cpp
parentAlways connect to local socket (diff)
downloadsmolbote-d1635b36d00b7239cbebcf9f78e9c8615ac1d7d5.tar.xz
Fixed bug where refresh button and loading bar would get stuck in loading state
Diffstat (limited to 'src/mainwindow/widgets/loadingbar.cpp')
-rw-r--r--src/mainwindow/widgets/loadingbar.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mainwindow/widgets/loadingbar.cpp b/src/mainwindow/widgets/loadingbar.cpp
index 2c12371..76eafc4 100644
--- a/src/mainwindow/widgets/loadingbar.cpp
+++ b/src/mainwindow/widgets/loadingbar.cpp
@@ -22,6 +22,7 @@ void LoadingBar::connectWebView(WebView *view)
disconnect(loadStartedConnection);
disconnect(loadProgressConnection);
+ disconnect(loadedConnection);
disconnect(loadFinishedConnection);
if(view->isLoaded()) {
@@ -33,6 +34,9 @@ void LoadingBar::connectWebView(WebView *view)
loadStartedConnection = connect(view, &QWebEngineView::loadStarted, this, &LoadingBar::loadStarted);
loadProgressConnection = connect(view, &QWebEngineView::loadProgress, this, &QProgressBar::setValue);
+ loadedConnection = connect(view, &WebView::loaded, this, [this]() {
+ QTimer::singleShot(2000, this, &LoadingBar::hide);
+ });
loadFinishedConnection = connect(view, &QWebEngineView::loadFinished, this, &LoadingBar::loadFinished);
}
@@ -46,5 +50,4 @@ void LoadingBar::loadStarted()
void LoadingBar::loadFinished(bool ok)
{
setFormat(QString("%p% %1").arg(ok ? tr("Finished") : tr("Failed")));
- QTimer::singleShot(2000, this, SLOT(hide()));
}