summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <[email protected]>2015-07-30 08:41:55 +0200
committerDennis Nienhüser <[email protected]>2015-07-30 08:54:31 +0200
commit62797313aa22b846a03ae19324f4b29845fe7568 (patch)
tree06acb29a9eb7a48156212b758fc32955539ff1b3
parent23ebc1d7116c1cdbbb37d9df34fe47668fe4cbe6 (diff)
Change QT_NO_WEBKIT to MARBLE_NO_WEBKIT
Fixes compilation with Qt 4. MARBLE_NO_WEBKIT is set if webkit is not found by cmake. REVIEW: 124526 BUG: 350749 (cherry picked from commit c67ebec4d8f50a03998e40cc0aacaa881d5625af)
-rw-r--r--CMakeLists.txt7
-rw-r--r--src/apps/marble-mobile/MobileMainWindow.cpp2
-rw-r--r--src/lib/marble/CMakeLists.txt10
-rw-r--r--src/lib/marble/LegendWidget.cpp2
-rw-r--r--src/lib/marble/MarbleLegendBrowser.cpp12
-rw-r--r--src/lib/marble/MarbleLegendBrowser.h2
-rw-r--r--src/lib/marble/PopupItem.cpp18
-rw-r--r--src/lib/marble/PopupItem.h2
-rw-r--r--src/lib/marble/cloudsync/RouteItemDelegate.cpp2
-rw-r--r--src/lib/marble/routing/RoutingInputWidget.cpp2
-rw-r--r--src/plugins/render/CMakeLists.txt2
11 files changed, 35 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c83158..560647e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,6 +81,10 @@ if(ANDROID)
else()
find_package(Qt5WebKitWidgets)
find_package(Qt5DBus)
+
+ if ( NOT Qt5Webkit_FOUND )
+ set ( MARBLE_NO_WEBKIT TRUE )
+ endif()
endif()
find_package(Qt5Core)
@@ -146,6 +150,9 @@ else()
FIND_PACKAGE(QtDeclarative)
include_directories(${QT_QTDECLARATIVE_INCLUDE_DIR})
endif()
+ if ( NOT QT_QTWEBKIT_FOUND )
+ set ( MARBLE_NO_WEBKIT TRUE )
+ endif()
endif()
SET(CMAKE_AUTOMOC TRUE)
diff --git a/src/apps/marble-mobile/MobileMainWindow.cpp b/src/apps/marble-mobile/MobileMainWindow.cpp
index 89db918..d17dde4 100644
--- a/src/apps/marble-mobile/MobileMainWindow.cpp
+++ b/src/apps/marble-mobile/MobileMainWindow.cpp
@@ -97,7 +97,9 @@ MainWindow::MainWindow( const QString &marbleDataPath, const QVariantMap &cmdLin
// prevent triggering of network requests under Maemo, presumably due to qrc: URLs
m_networkAccessManager.setNetworkAccessible( QNetworkAccessManager::NotAccessible );
+#ifndef MARBLE_NO_WEBKIT
m_legendBrowser->page()->setNetworkAccessManager( &m_networkAccessManager );
+#endif
QString selectedPath = marbleDataPath.isEmpty() ? readMarbleDataPath() : marbleDataPath;
if ( !selectedPath.isEmpty() )
diff --git a/src/lib/marble/CMakeLists.txt b/src/lib/marble/CMakeLists.txt
index 78f5395..26eda3e 100644
--- a/src/lib/marble/CMakeLists.txt
+++ b/src/lib/marble/CMakeLists.txt
@@ -52,8 +52,8 @@ if( QT5BUILD )
set(marblequick_SRCS MarbleQuickItem.cpp)
endif()
-if(QT_NO_WEBKIT)
-add_definitions(-DQT_NO_WEBKIT)
+if(MARBLE_NO_WEBKIT)
+add_definitions(-DMARBLE_NO_WEBKIT)
endif()
set(marblewidget_SRCS
@@ -293,7 +293,7 @@ set(marblewidget_SRCS
)
-if (QT_NO_WEBKIT)
+if (MARBLE_NO_WEBKIT)
LIST(APPEND marblewidget_SRCS
NullMarbleWebView.cpp
NullTinyWebBrowser.cpp
@@ -352,7 +352,7 @@ set (marblewidget_UI
FormattedTextWidget.ui
ElevationWidget.ui
)
-if (QT_NO_WEBKIT)
+if (MARBLE_NO_WEBKIT)
LIST(APPEND marblewidget_UI
NullLegendWidget.ui
NullWebPopupWidget.ui
@@ -448,7 +448,7 @@ if( QT5BUILD )
set(marblequick_HDRS MarbleQuickItem.h)
endif()
-if (QT_NO_WEBKIT)
+if (MARBLE_NO_WEBKIT)
set(marble_WebKit
NullMarbleWebView.h
NullTinyWebBrowser.h
diff --git a/src/lib/marble/LegendWidget.cpp b/src/lib/marble/LegendWidget.cpp
index 7399e57..9fbd1fb 100644
--- a/src/lib/marble/LegendWidget.cpp
+++ b/src/lib/marble/LegendWidget.cpp
@@ -16,7 +16,7 @@
using namespace Marble;
// Ui
-#ifdef QT_NO_WEBKIT
+#ifdef MARBLE_NO_WEBKIT
#include "ui_NullLegendWidget.h"
#else
#include "ui_LegendWidget.h"
diff --git a/src/lib/marble/MarbleLegendBrowser.cpp b/src/lib/marble/MarbleLegendBrowser.cpp
index 3af1f80..04a3588 100644
--- a/src/lib/marble/MarbleLegendBrowser.cpp
+++ b/src/lib/marble/MarbleLegendBrowser.cpp
@@ -28,7 +28,7 @@
#include <QStyleOptionButton>
#include <QRegExp>
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
#include <QWebFrame>
#include <QWebElement>
#endif
@@ -76,7 +76,7 @@ MarbleLegendBrowser::MarbleLegendBrowser( QWidget *parent )
d->m_suppressSelection = false;
#endif // Q_WS_MAEMO_5
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
QWebFrame *frame = page()->mainFrame();
connect(frame, SIGNAL(javaScriptWindowObjectCleared()),
this, SLOT(injectCheckBoxChecker()));
@@ -133,7 +133,7 @@ void MarbleLegendBrowser::initTheme()
void MarbleLegendBrowser::loadLegend()
{
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
if (d->m_currentThemeId != d->m_marbleModel->mapThemeId()) {
d->m_currentThemeId = d->m_marbleModel->mapThemeId();
} else {
@@ -185,7 +185,7 @@ void MarbleLegendBrowser::loadLegend()
void MarbleLegendBrowser::injectCheckBoxChecker()
{
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
QWebFrame *frame = page()->mainFrame();
frame->addToJavaScriptWindowObject( "Marble", this );
#endif
@@ -384,7 +384,7 @@ QString MarbleLegendBrowser::generateSectionsHtml()
void MarbleLegendBrowser::setCheckedProperty( const QString& name, bool checked )
{
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
QWebElement box = page()->mainFrame()->findFirstElement("input[name="+name+']');
if (!box.isNull()) {
if (checked != d->m_checkBoxMap[name]) {
@@ -399,7 +399,7 @@ void MarbleLegendBrowser::setCheckedProperty( const QString& name, bool checked
void MarbleLegendBrowser::setRadioCheckedProperty( const QString& value, const QString& name , bool checked )
{
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
QWebElement box = page()->mainFrame()->findFirstElement("input[value="+value+']');
QWebElementCollection boxes = page()->mainFrame()->findAllElements("input[name="+name+']');
QString currentValue="";
diff --git a/src/lib/marble/MarbleLegendBrowser.h b/src/lib/marble/MarbleLegendBrowser.h
index 936eedb..bbc2de1 100644
--- a/src/lib/marble/MarbleLegendBrowser.h
+++ b/src/lib/marble/MarbleLegendBrowser.h
@@ -20,7 +20,7 @@
#include <QString>
-#ifdef QT_NO_WEBKIT
+#ifdef MARBLE_NO_WEBKIT
#include "NullMarbleWebView.h"
#else
#include "MarbleWebView.h"
diff --git a/src/lib/marble/PopupItem.cpp b/src/lib/marble/PopupItem.cpp
index 41e108a..c2c81f9 100644
--- a/src/lib/marble/PopupItem.cpp
+++ b/src/lib/marble/PopupItem.cpp
@@ -14,7 +14,7 @@
#include "PopupItem.h"
#include "MarbleWidget.h"
-#ifdef QT_NO_WEBKIT
+#ifdef MARBLE_NO_WEBKIT
#include "NullMarbleWebView.h"
#else
#include <QWebView>
@@ -68,7 +68,7 @@ PopupItem::PopupItem( QObject* parent ) :
QPalette palette = m_ui.webView->palette();
palette.setBrush(QPalette::Base, Qt::transparent);
m_ui.webView->setPalette(palette);
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
m_ui.webView->page()->setPalette(palette);
#endif
m_ui.webView->setAttribute(Qt::WA_OpaquePaintEvent, false);
@@ -78,7 +78,7 @@ PopupItem::PopupItem( QObject* parent ) :
connect( m_ui.webView, SIGNAL(urlChanged(QUrl)), this, SLOT(updateBackButton()) );
connect( m_ui.hideButton, SIGNAL(clicked()), this, SIGNAL(hide()) );
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
// Update the popupitem on changes while loading the webpage
connect( m_ui.webView->page(), SIGNAL(repaintRequested(QRect)), this, SLOT(requestUpdate()) );
#endif
@@ -107,7 +107,7 @@ void PopupItem::setUrl( const QUrl &url )
QPalette palette = m_ui.webView->palette();
palette.setBrush(QPalette::Base, Qt::transparent);
m_ui.webView->setPalette(palette);
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
m_ui.webView->page()->setPalette(palette);
#endif
m_ui.webView->setAttribute(Qt::WA_OpaquePaintEvent, false);
@@ -119,7 +119,7 @@ void PopupItem::setContent( const QString &html, const QUrl &baseUrl )
{
m_content = html;
m_baseUrl = baseUrl;
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
m_ui.webView->setHtml( html, baseUrl );
#endif
@@ -344,7 +344,7 @@ void PopupItem::clearHistory()
{
m_content.clear();
m_ui.webView->setUrl( QUrl( "about:blank" ) );
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
m_ui.webView->history()->clear();
#endif
}
@@ -358,7 +358,7 @@ void PopupItem::requestUpdate()
void PopupItem::printContent() const
{
#ifndef QT_NO_PRINTER
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
QPrinter printer;
QPointer<QPrintDialog> dialog = new QPrintDialog(&printer);
if (dialog->exec() == QPrintDialog::Accepted) {
@@ -371,7 +371,7 @@ void PopupItem::printContent() const
void PopupItem::updateBackButton()
{
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
bool const hasHistory = m_ui.webView->history()->count() > 1;
bool const previousIsHtml = !m_content.isEmpty() && m_ui.webView->history()->currentItemIndex() == 1;
bool const atStart = m_ui.webView->history()->currentItemIndex() <= 1;
@@ -382,7 +382,7 @@ void PopupItem::updateBackButton()
void PopupItem::goBack()
{
-#ifndef QT_NO_WEBKIT
+#ifndef MARBLE_NO_WEBKIT
if ( m_ui.webView->history()->currentItemIndex() == 1 && !m_content.isEmpty() ) {
m_ui.webView->setHtml( m_content, m_baseUrl );
} else {
diff --git a/src/lib/marble/PopupItem.h b/src/lib/marble/PopupItem.h
index 9947a78..56fd7c0 100644
--- a/src/lib/marble/PopupItem.h
+++ b/src/lib/marble/PopupItem.h
@@ -19,7 +19,7 @@
#include "BillboardGraphicsItem.h"
-#ifdef QT_NO_WEBKIT
+#ifdef MARBLE_NO_WEBKIT
#include "ui_NullWebPopupWidget.h"
#else
#include "ui_WebPopupWidget.h"
diff --git a/src/lib/marble/cloudsync/RouteItemDelegate.cpp b/src/lib/marble/cloudsync/RouteItemDelegate.cpp
index 03be997..ffc4a2d 100644
--- a/src/lib/marble/cloudsync/RouteItemDelegate.cpp
+++ b/src/lib/marble/cloudsync/RouteItemDelegate.cpp
@@ -2,7 +2,7 @@
#include <QPainter>
-#ifdef QT_NO_WEBKIT
+#ifdef MARBLE_NO_WEBKIT
#include <QWidget>
#else
#include <QWebView>
diff --git a/src/lib/marble/routing/RoutingInputWidget.cpp b/src/lib/marble/routing/RoutingInputWidget.cpp
index 2ec32f0..00aa0e7 100644
--- a/src/lib/marble/routing/RoutingInputWidget.cpp
+++ b/src/lib/marble/routing/RoutingInputWidget.cpp
@@ -15,7 +15,7 @@
#include "MarblePlacemarkModel.h"
#include "RouteRequest.h"
-#ifdef QT_NO_WEBKIT
+#ifdef MARBLE_NO_WEBKIT
#include "NullTinyWebBrowser.h"
#else
#include "TinyWebBrowser.h"
diff --git a/src/plugins/render/CMakeLists.txt b/src/plugins/render/CMakeLists.txt
index 9f7126c..bdfc085 100644
--- a/src/plugins/render/CMakeLists.txt
+++ b/src/plugins/render/CMakeLists.txt
@@ -51,4 +51,4 @@ marble_set_package_properties( Perl PROPERTIES URL "http://www.perl.org" )
marble_set_package_properties( Perl PROPERTIES TYPE OPTIONAL PURPOSE "generation of sources in the APRS plugin" )
if( PERL_FOUND )
add_subdirectory( aprs )
-endif() \ No newline at end of file
+endif()