summaryrefslogtreecommitdiffstats
path: root/src/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 55443b3..745d700 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -62,13 +62,20 @@ WebView::WebView(QWidget* parent)
connect(page(), SIGNAL(downloadRequested(QNetworkRequest)),this,SLOT(downloadRequest(QNetworkRequest)));
connect(_timerAbortMessage, &QTimer::timeout, this, &WebView::downloadDeniedMessage);
connect(_timerReset, &QTimer::timeout, this, [this]() {
- this->stop();
- this->page()->mainFrame()->setContent("");
+ this->resetBrowserAndTimeout();
emit triggerReset(tr("Inactivity Timeout"));
});
connect(this, &QWebView::loadFinished, this, &WebView::onLoadFinished);
}
+void WebView::resetBrowserAndTimeout()
+{
+ _timerReset->stop();
+ _timerAbortMessage->stop();
+ this->stop();
+ this->page()->mainFrame()->setContent("");
+}
+
void WebView::jsInjector(QWebFrame *frame)
{
QString str = Global::getCombinedIdpWhitelist().replace(
@@ -201,9 +208,6 @@ void WebView::reset(const QString baseUrl)
_firstLoad = true;
_timerAbortMessage->stop();
_timerReset->stop();
- QTimer::singleShot(5000, [this]() {
- _timerReset->stop();
- });
}
static QRegularExpression urlListToRegExp(const QStringList &list)