1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

fixed build for qt versions < 5.11

Summary: Build is broken because QWebEngineRequestJob::initiator is added in 5.11. This patch fixes the build with Qt < 5.11.

Reviewers: drosca

Reviewed By: drosca

Subscribers: falkon

Tags: #falkon

Differential Revision: https://phabricator.kde.org/D15832
This commit is contained in:
Anmol Gautam 2018-09-29 20:35:48 +05:30
parent 5daddc4c6c
commit 7c570c93db
4 changed files with 12 additions and 10 deletions

View File

@ -59,13 +59,16 @@ void QmlWebEngineUrlRequestJob::reply(const QVariantMap &map)
buffer->seek(0);
m_job->reply(contentType, buffer);
}
QString QmlWebEngineUrlRequestJob::initiator() const
{
if (!m_job) {
return QString();
}
return QString::fromUtf8(m_job->initiator().toEncoded());
QString initiatorString;
#if QTWEBENGINE_VERSION >= QT_VERSION_CHECK(5, 11, 0)
initiatorString = QString::fromUtf8(m_job->initiator().toEncoded());
#endif
return initiatorString;
}
QString QmlWebEngineUrlRequestJob::requestUrl() const

View File

@ -70,7 +70,6 @@ public:
Q_INVOKABLE void reply(const QVariantMap &map);
private:
QWebEngineUrlRequestJob *m_job = nullptr;
QString initiator() const;
QString requestUrl() const;
QString requestMethod() const;

View File

@ -49,15 +49,15 @@ class QmlPluginInterface : public QObject, public PluginInterface
public:
explicit QmlPluginInterface();
~QmlPluginInterface();
DesktopFile metaData() const;
void init(InitState state, const QString &settingsPath);
void unload();
bool testPlugin();
~QmlPluginInterface() override;
DesktopFile metaData() const override;
void init(InitState state, const QString &settingsPath) override;
void unload() override;
bool testPlugin() override;
void setEngine(QQmlEngine *engine);
void setName(const QString &name);
void populateWebViewMenu(QMenu *menu, WebView *webview, const WebHitTestResult &webHitTestResult) override;
void showSettings(QWidget *parent = nullptr);
void showSettings(QWidget *parent = nullptr) override;
bool mouseDoubleClick(Qz::ObjectName type, QObject *obj, QMouseEvent *event) override;
bool mousePress(Qz::ObjectName type, QObject *obj, QMouseEvent *event) override;

View File

@ -66,7 +66,7 @@ void QmlPluginLoader::initEngineAndComponent()
m_component = new QQmlComponent(m_engine, QDir(m_path).filePath(m_entryPoint));
m_engine->setExtensionPath(m_path);
m_engine->setExtensionName(m_name);
#ifdef HAVE_LIBINTL
#if HAVE_LIBINTL
auto i18n = new QmlI18n(m_name);
m_engine->globalObject().setProperty(QSL("__falkon_i18n"), m_engine->newQObject(i18n));
m_engine->globalObject().setProperty(QSL("i18n"), m_engine->evaluate(QSL("function (s) { return __falkon_i18n.i18n(s) }")));