mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Correctly handle possibility that page changes in WebView
This commit is contained in:
parent
b5d872f64e
commit
1fe7f0c232
@ -144,8 +144,12 @@ PopupWindow::PopupWindow(PopupWebView* view)
|
||||
connect(m_view, &WebView::loadProgress, this, &PopupWindow::loadProgress);
|
||||
connect(m_view, &WebView::loadFinished, this, &PopupWindow::loadFinished);
|
||||
|
||||
connect(m_view->page(), &WebPage::linkHovered, this, &PopupWindow::showStatusBarMessage);
|
||||
connect(m_view->page(), &WebPage::geometryChangeRequested, this, &PopupWindow::setWindowGeometry);
|
||||
auto pageChanged = [this](WebPage *page) {
|
||||
connect(page, &WebPage::linkHovered, this, &PopupWindow::showStatusBarMessage);
|
||||
connect(page, &WebPage::geometryChangeRequested, this, &PopupWindow::setWindowGeometry);
|
||||
};
|
||||
pageChanged(m_view->page());
|
||||
connect(m_view, &WebView::pageChanged, this, pageChanged);
|
||||
|
||||
m_view->setFocus();
|
||||
titleChanged();
|
||||
|
@ -65,7 +65,12 @@ void TabIcon::setWebTab(WebTab* tab)
|
||||
connect(m_tab->webView(), SIGNAL(loadFinished(bool)), this, SLOT(hideLoadingAnimation()));
|
||||
connect(m_tab->webView(), &WebView::iconChanged, this, &TabIcon::updateIcon);
|
||||
connect(m_tab->webView(), &WebView::backgroundActivityChanged, this, [this]() { update(); });
|
||||
connect(m_tab->webView()->page(), &QWebEnginePage::recentlyAudibleChanged, this, &TabIcon::updateAudioIcon);
|
||||
|
||||
auto pageChanged = [this](WebPage *page) {
|
||||
connect(page, &QWebEnginePage::recentlyAudibleChanged, this, &TabIcon::updateAudioIcon);
|
||||
};
|
||||
pageChanged(m_tab->webView()->page());
|
||||
connect(m_tab->webView(), &WebView::pageChanged, this, pageChanged);
|
||||
|
||||
updateIcon();
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* ============================================================
|
||||
* Falkon - Qt web browser
|
||||
* Copyright (C) 2013-2015 David Rosca <nowrep@gmail.com>
|
||||
* Copyright (C) 2013-2018 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -19,6 +20,7 @@
|
||||
#define HTML5PERMISSIONSNOTIFICATION_H
|
||||
|
||||
#include <QString>
|
||||
#include <QPointer>
|
||||
|
||||
#include "animatedwidget.h"
|
||||
#include "webpage.h"
|
||||
@ -44,7 +46,7 @@ private:
|
||||
Ui::HTML5PermissionsNotification* ui;
|
||||
|
||||
QUrl m_origin;
|
||||
QWebEnginePage* m_page;
|
||||
QPointer<QWebEnginePage> m_page;
|
||||
QWebEnginePage::Feature m_feature;
|
||||
};
|
||||
|
||||
|
@ -789,11 +789,16 @@ void TabItem::setWebTab(WebTab* webTab)
|
||||
else
|
||||
setIsSavedTab(true);
|
||||
|
||||
connect(m_webTab->webView()->page(), SIGNAL(audioMutedChanged(bool)), this, SLOT(updateIcon()));
|
||||
connect(m_webTab->webView()->page(), SIGNAL(loadFinished(bool)), this, SLOT(updateIcon()));
|
||||
connect(m_webTab->webView()->page(), SIGNAL(loadStarted()), this, SLOT(updateIcon()));
|
||||
connect(m_webTab->webView(), SIGNAL(titleChanged(QString)), this, SLOT(setTitle(QString)));
|
||||
connect(m_webTab->webView(), SIGNAL(iconChanged(QIcon)), this, SLOT(updateIcon()));
|
||||
|
||||
auto pageChanged = [this](WebPage *page) {
|
||||
connect(page, &WebPage::audioMutedChanged, this, &TabItem::updateIcon);
|
||||
connect(page, &WebPage::loadFinished, this, &TabItem::updateIcon);
|
||||
connect(page, &WebPage::loadStarted, this, &TabItem::updateIcon);
|
||||
};
|
||||
pageChanged(m_webTab->webView()->page());
|
||||
connect(m_webTab->webView(), &WebView::pageChanged, this, pageChanged);
|
||||
}
|
||||
|
||||
void TabItem::updateIcon()
|
||||
|
Loading…
Reference in New Issue
Block a user