mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
WebView: Remove QWebChannel resetting workaround
It was fixed while ago in Qt
This commit is contained in:
parent
5f0f520a45
commit
8a942e2e73
|
@ -73,7 +73,9 @@ WebPage::WebPage(QObject* parent)
|
||||||
, m_secureStatus(false)
|
, m_secureStatus(false)
|
||||||
, m_adjustingScheduled(false)
|
, m_adjustingScheduled(false)
|
||||||
{
|
{
|
||||||
setupWebChannel();
|
QWebChannel *channel = new QWebChannel(this);
|
||||||
|
channel->registerObject(QSL("qz_object"), new ExternalJsObject(this));
|
||||||
|
setWebChannel(channel);
|
||||||
|
|
||||||
connect(this, &QWebEnginePage::loadProgress, this, &WebPage::progress);
|
connect(this, &QWebEnginePage::loadProgress, this, &WebPage::progress);
|
||||||
connect(this, &QWebEnginePage::loadFinished, this, &WebPage::finished);
|
connect(this, &QWebEnginePage::loadFinished, this, &WebPage::finished);
|
||||||
|
@ -312,21 +314,6 @@ void WebPage::desktopServicesOpen(const QUrl &url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebPage::setupWebChannel()
|
|
||||||
{
|
|
||||||
QWebChannel *old = webChannel();
|
|
||||||
const QString objectName = QSL("qz_object");
|
|
||||||
|
|
||||||
QWebChannel *channel = new QWebChannel(this);
|
|
||||||
channel->registerObject(QSL("qz_object"), new ExternalJsObject(this));
|
|
||||||
setWebChannel(channel);
|
|
||||||
|
|
||||||
if (old) {
|
|
||||||
delete old->registeredObjects().value(objectName);
|
|
||||||
delete old;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebPage::windowCloseRequested()
|
void WebPage::windowCloseRequested()
|
||||||
{
|
{
|
||||||
if (!view())
|
if (!view())
|
||||||
|
|
|
@ -69,8 +69,6 @@ public:
|
||||||
|
|
||||||
bool isLoading() const;
|
bool isLoading() const;
|
||||||
|
|
||||||
void setupWebChannel();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void privacyChanged(bool status);
|
void privacyChanged(bool status);
|
||||||
|
|
||||||
|
|
|
@ -262,9 +262,6 @@ void WebView::restoreHistory(const QByteArray &data)
|
||||||
{
|
{
|
||||||
QDataStream stream(data);
|
QDataStream stream(data);
|
||||||
stream >> *history();
|
stream >> *history();
|
||||||
|
|
||||||
// Workaround clearing QWebChannel after restoring history
|
|
||||||
page()->setupWebChannel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *WebView::inputWidget() const
|
QWidget *WebView::inputWidget() const
|
||||||
|
|
Loading…
Reference in New Issue
Block a user