From ef4cfad805e9f910535fb46232aae43e519e2bad Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 19 Jan 2013 19:37:40 +0100 Subject: [PATCH] Removed USE_QTWEBKIT_2_2 build variable. It will now be automatically detected. It assume that if you are building with Qt 4.8 and higher, you have QtWebKit 2.2 and higher. --- BUILDING | 18 ++++-------------- src/defines.pri | 4 ++++ .../html5permissionsmanager.cpp | 3 ++- .../html5permissions/html5permissionsmanager.h | 4 +++- .../html5permissionsnotification.cpp | 2 ++ .../html5permissionsnotification.h | 4 +++- src/lib/webview/webpage.cpp | 4 ++-- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/BUILDING b/BUILDING index 7d0ca872f..867008a98 100644 --- a/BUILDING +++ b/BUILDING @@ -35,16 +35,16 @@ Linux / Unix ---------------------------------------------------------------------------------- There is no extra dependency, you only need Qt tools. - + MAC OS X ---------------------------------------------------------------------------------- There is no extra dependency, you only need Qt tools and XCode. After successful compilation, you need to run macdeploy.sh script to correctly build the application bundle. You will do it with following command: - + $ ./scripts/macdeploy.sh - + You need to specifiy path to macdeployqt (usually in QTDIR/bin/macdeployqt) only if it is not in PATH. @@ -53,7 +53,7 @@ OS/2 I cannot provide support for QupZilla on OS/2 as I don't have access to machine with OS/2, but it is possible to get QupZilla working there. - + Builds are provided by netlabs.org (http://svn.netlabs.org/qtapps/wiki/QT4%20Networking) FreeBSD @@ -89,16 +89,6 @@ Available Defines example: $ export USE_WEBGL="true" - USE_QTWEBKIT_2_2 Enable support for Geolocation and Notifications API. - You need to have QtWebKit version at least 2.2 to pass compilation - with this define. - Note: In order to get support for Geolocation and Notifications, - your QtWebKit has to be compiled with its support. - (disabled by default) - - example: - $ export USE_QTWEBKIT_2_2="true" - NONBLOCK_JS_DIALOGS Enable non-blocking JavaScript dialogs from alert() prompt() and confirm() functions. They are shown inside page and are not blocking application window. diff --git a/src/defines.pri b/src/defines.pri index d82dfc48a..bbac1db5f 100644 --- a/src/defines.pri +++ b/src/defines.pri @@ -15,6 +15,10 @@ 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 +} + DEFINES *= QT_NO_URL_CAST_FROM_STRING DEFINES *= QT_USE_QSTRINGBUILDER diff --git a/src/lib/tools/html5permissions/html5permissionsmanager.cpp b/src/lib/tools/html5permissions/html5permissionsmanager.cpp index dc5cd635d..e4f9f4b68 100644 --- a/src/lib/tools/html5permissions/html5permissionsmanager.cpp +++ b/src/lib/tools/html5permissions/html5permissionsmanager.cpp @@ -1,7 +1,6 @@ #include "html5permissionsmanager.h" #include "html5permissionsnotification.h" #include "settings.h" -#include "webpage.h" #include "webview.h" #include @@ -13,6 +12,7 @@ HTML5PermissionsManager::HTML5PermissionsManager(QObject *parent) loadSettings(); } +#if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) void HTML5PermissionsManager::requestPermissions(WebPage* page, QWebFrame *frame, const QWebPage::Feature &feature) { if (!frame || !page) { @@ -98,6 +98,7 @@ void HTML5PermissionsManager::rememberPermissions(const QString &host, const QWe saveSettings(); } +#endif void HTML5PermissionsManager::loadSettings() { diff --git a/src/lib/tools/html5permissions/html5permissionsmanager.h b/src/lib/tools/html5permissions/html5permissionsmanager.h index b75c201c9..ecdbb58b4 100644 --- a/src/lib/tools/html5permissions/html5permissionsmanager.h +++ b/src/lib/tools/html5permissions/html5permissionsmanager.h @@ -3,9 +3,9 @@ #include #include -#include #include "qz_namespace.h" +#include "webpage.h" class QUrl; class WebPage; @@ -15,9 +15,11 @@ class QT_QUPZILLA_EXPORT HTML5PermissionsManager : public QObject public: explicit HTML5PermissionsManager(QObject* parent); +#ifdef USE_QTWEBKIT_2_2 void requestPermissions(WebPage* page, QWebFrame* frame, const QWebPage::Feature &feature); void rememberPermissions(const QString &host, const QWebPage::Feature &feature, const QWebPage::PermissionPolicy &policy); +#endif void loadSettings(); void showSettingsDialog(); diff --git a/src/lib/tools/html5permissions/html5permissionsnotification.cpp b/src/lib/tools/html5permissions/html5permissionsnotification.cpp index 455b30114..afb6726d5 100644 --- a/src/lib/tools/html5permissions/html5permissionsnotification.cpp +++ b/src/lib/tools/html5permissions/html5permissionsnotification.cpp @@ -6,6 +6,7 @@ #include +#if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) HTML5PermissionsNotification::HTML5PermissionsNotification(const QString &host, QWebFrame *frame, const QWebPage::Feature &feature) : AnimatedWidget(AnimatedWidget::Down, 300, 0) , ui(new Ui::HTML5PermissionsNotification) @@ -74,3 +75,4 @@ HTML5PermissionsNotification::~HTML5PermissionsNotification() { delete ui; } +#endif // (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) diff --git a/src/lib/tools/html5permissions/html5permissionsnotification.h b/src/lib/tools/html5permissions/html5permissionsnotification.h index 8f86e39ab..5d71ac113 100644 --- a/src/lib/tools/html5permissions/html5permissionsnotification.h +++ b/src/lib/tools/html5permissions/html5permissionsnotification.h @@ -1,10 +1,10 @@ #ifndef HTML5PERMISSIONSNOTIFICATION_H #define HTML5PERMISSIONSNOTIFICATION_H -#include #include #include "animatedwidget.h" +#include "webpage.h" namespace Ui { @@ -15,6 +15,7 @@ class HTML5PermissionsNotification : public AnimatedWidget { Q_OBJECT +#ifdef USE_QTWEBKIT_2_2 public: explicit HTML5PermissionsNotification(const QString &host, QWebFrame* frame, const QWebPage::Feature &feature); ~HTML5PermissionsNotification(); @@ -29,6 +30,7 @@ private: QString m_host; QWebFrame* m_frame; QWebPage::Feature m_feature; +#endif }; #endif // HTML5PERMISSIONSNOTIFICATION_H diff --git a/src/lib/webview/webpage.cpp b/src/lib/webview/webpage.cpp index c301dc0c7..eec4260e1 100644 --- a/src/lib/webview/webpage.cpp +++ b/src/lib/webview/webpage.cpp @@ -94,7 +94,7 @@ WebPage::WebPage(QupZilla* mainClass) connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject())); -#ifdef USE_QTWEBKIT_2_2 +#if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(featurePermissionRequested(QWebFrame*, QWebPage::Feature))); #endif @@ -392,7 +392,7 @@ void WebPage::windowCloseRequested() webView->closeView(); } -#ifdef USE_QTWEBKIT_2_2 +#if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) void WebPage::featurePermissionRequested(QWebFrame* frame, const QWebPage::Feature &feature) { mApp->html5permissions()->requestPermissions(this, frame, feature);