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

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.
This commit is contained in:
nowrep 2013-01-19 19:37:40 +01:00
parent 81ac819746
commit ef4cfad805
7 changed files with 20 additions and 19 deletions

View File

@ -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.

View File

@ -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

View File

@ -1,7 +1,6 @@
#include "html5permissionsmanager.h"
#include "html5permissionsnotification.h"
#include "settings.h"
#include "webpage.h"
#include "webview.h"
#include <QWebFrame>
@ -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()
{

View File

@ -3,9 +3,9 @@
#include <QObject>
#include <QStringList>
#include <QWebPage>
#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();

View File

@ -6,6 +6,7 @@
#include <QWebFrame>
#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))

View File

@ -1,10 +1,10 @@
#ifndef HTML5PERMISSIONSNOTIFICATION_H
#define HTML5PERMISSIONSNOTIFICATION_H
#include <QWebPage>
#include <QString>
#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

View File

@ -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);