diff --git a/src/lib/webengine/webview.cpp b/src/lib/webengine/webview.cpp index ce15ebd05..5f328ae42 100644 --- a/src/lib/webengine/webview.cpp +++ b/src/lib/webengine/webview.cpp @@ -417,6 +417,10 @@ void WebView::printPage() void WebView::slotLoadStarted() { m_progress = 0; + + if (title(/*allowEmpty*/true).isEmpty()) { + emit titleChanged(title()); + } } void WebView::slotLoadProgress(int progress) @@ -446,7 +450,13 @@ void WebView::slotIconChanged() void WebView::slotUrlChanged(const QUrl &url) { - Q_UNUSED(url) + if (!url.isEmpty() && title(/*allowEmpty*/true).isEmpty()) { + // Don't treat this as background activity change + const bool oldActivity = m_backgroundActivity; + m_backgroundActivity = true; + emit titleChanged(title()); + m_backgroundActivity = oldActivity; + } // Don't save blank page / speed dial in tab history if (!history()->canGoForward() && history()->backItems(1).size() == 1) { diff --git a/src/lib/webtab/webtab.cpp b/src/lib/webtab/webtab.cpp index cd20e93e1..f99ea11aa 100644 --- a/src/lib/webtab/webtab.cpp +++ b/src/lib/webtab/webtab.cpp @@ -170,7 +170,6 @@ WebTab::WebTab(QWidget *parent) nlayout->setSpacing(1); connect(m_webView, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*))); - connect(m_webView, SIGNAL(loadStarted()), this, SLOT(loadStarted())); connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleWasChanged); connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleChanged); @@ -558,13 +557,6 @@ void WebTab::showNotification(QWidget* notif) notif->show(); } -void WebTab::loadStarted() -{ - if (m_tabBar && m_webView->title(/*allowEmpty*/true).isEmpty()) { - m_tabBar->setTabText(tabIndex(), tr("Loading...")); - } -} - void WebTab::loadFinished() { titleWasChanged(m_webView->title()); diff --git a/src/lib/webtab/webtab.h b/src/lib/webtab/webtab.h index 13820ceaa..e04caebf4 100644 --- a/src/lib/webtab/webtab.h +++ b/src/lib/webtab/webtab.h @@ -118,7 +118,6 @@ public: private slots: void showNotification(QWidget* notif); - void loadStarted(); void loadFinished(); signals: