diff --git a/src/defines.pri b/src/defines.pri index bbac1db5f..ea32e7465 100644 --- a/src/defines.pri +++ b/src/defines.pri @@ -15,8 +15,20 @@ win32-msvc* { LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib } -isEqual(QT_VERSION, 4.8.0)|greaterThan(QT_VERSION, 4.8.0) { - DEFINES *= USE_QTWEBKIT_2_2 +# Check for pkg-config availability +system(pkg-config --version) { + QTWEBKIT_VERSION = $$system(pkg-config --modversion QtWebKit) + QTWEBKIT_VERSION_MAJOR = $$section(QTWEBKIT_VERSION, ".", 0, 0) + QTWEBKIT_VERSION_MINOR = $$section(QTWEBKIT_VERSION, ".", 1, 1) + + greaterThan(QTWEBKIT_VERSION_MAJOR, 3):greaterThan(QTWEBKIT_VERSION_MINOR, 8) { + DEFINES *= USE_QTWEBKIT_2_2 + } +} +else { + isEqual(QT_VERSION, 4.8.0)|greaterThan(QT_VERSION, 4.8.0) { + DEFINES *= USE_QTWEBKIT_2_2 + } } DEFINES *= QT_NO_URL_CAST_FROM_STRING diff --git a/src/lib/tools/html5permissions/html5permissionsnotification.cpp b/src/lib/tools/html5permissions/html5permissionsnotification.cpp index c0d83d6f3..7d6dbc39d 100644 --- a/src/lib/tools/html5permissions/html5permissionsnotification.cpp +++ b/src/lib/tools/html5permissions/html5permissionsnotification.cpp @@ -23,7 +23,7 @@ #include -#if QTWEBKIT_FROM_2_2 +#if USE_QTWEBKIT_2_2 HTML5PermissionsNotification::HTML5PermissionsNotification(const QString &host, QWebFrame* frame, const QWebPage::Feature &feature) : AnimatedWidget(AnimatedWidget::Down, 300, 0) , ui(new Ui::HTML5PermissionsNotification) diff --git a/src/lib/webview/webpage.cpp b/src/lib/webview/webpage.cpp index 9aef28f1e..8dd358f9b 100644 --- a/src/lib/webview/webpage.cpp +++ b/src/lib/webview/webpage.cpp @@ -418,7 +418,7 @@ void WebPage::dbQuotaExceeded(QWebFrame* frame) frame->securityOrigin().setDatabaseQuota(oldQuota * 2); } -#if QTWEBKIT_FROM_2_2 +#if USE_QTWEBKIT_2_2 void WebPage::appCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 originalQuota) { if (!origin) {