1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

WebView: Remove QWebChannel resetting workaround

It was fixed while ago in Qt
This commit is contained in:
David Rosca 2017-02-06 20:45:28 +01:00
parent 5f0f520a45
commit 8a942e2e73
3 changed files with 3 additions and 21 deletions

View File

@ -73,7 +73,9 @@ WebPage::WebPage(QObject* parent)
, m_secureStatus(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::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()
{
if (!view())

View File

@ -69,8 +69,6 @@ public:
bool isLoading() const;
void setupWebChannel();
signals:
void privacyChanged(bool status);

View File

@ -262,9 +262,6 @@ void WebView::restoreHistory(const QByteArray &data)
{
QDataStream stream(data);
stream >> *history();
// Workaround clearing QWebChannel after restoring history
page()->setupWebChannel();
}
QWidget *WebView::inputWidget() const