From 7d6f2bb45af5f1ae635058d6d32b47fc2000bd67 Mon Sep 17 00:00:00 2001 From: Patrick Star <qtc-committer@nokia.com> Date: Tue, 2 Dec 2008 13:38:31 +0100 Subject: [PATCH] Fixes: - use QT_NO_WEBKIT instead of QT_WEBKIT, USE_WEBKIT Task: - none AutoTest: - compile test Details: - use QT_NO_WEBKIT instead of QT_WEBKIT, USE_WEBKIT --- shared/help/helpviewer.cpp | 2 +- shared/help/helpviewer.h | 4 ++-- src/plugins/coreplugin/coreplugin.cpp | 4 ++-- src/plugins/coreplugin/coreplugin.pro | 3 +-- src/plugins/coreplugin/welcomemode.cpp | 12 ++++++------ src/plugins/help/centralwidget.cpp | 8 ++++---- src/plugins/help/help.pro | 4 ++-- src/plugins/help/helpfindsupport.cpp | 2 +- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/shared/help/helpviewer.cpp b/shared/help/helpviewer.cpp index 0434fee4ca9..ff84273f722 100644 --- a/shared/help/helpviewer.cpp +++ b/shared/help/helpviewer.cpp @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE -#if defined(USE_WEBKIT) +#if !defined(QT_NO_WEBKIT) class HelpNetworkReply : public QNetworkReply { diff --git a/shared/help/helpviewer.h b/shared/help/helpviewer.h index 3156f196d06..ce11994625e 100644 --- a/shared/help/helpviewer.h +++ b/shared/help/helpviewer.h @@ -39,7 +39,7 @@ #include <QtGui/QTextBrowser> #include <QtGui/QAction> -#if defined(USE_WEBKIT) +#if !defined(QT_NO_WEBKIT) #include <QWebView> #endif @@ -54,7 +54,7 @@ class QKeyEvent; class QMouseEvent; class QContextMenuEvent; -#if defined(USE_WEBKIT) +#if !defined(QT_NO_WEBKIT) class HelpViewer : public QWebView { diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 070edd9a6a7..724285c4c4f 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -40,7 +40,7 @@ #include "fileiconprovider.h" #include <QtCore/qplugin.h> -#ifdef QT_WEBKIT +#if !defined(QT_NO_WEBKIT) #include <QtGui/QApplication> #include <QtWebKit/QWebSettings> #endif @@ -74,7 +74,7 @@ bool CorePlugin::initialize(const QStringList & /*arguments*/, QString *error_me m_pm = ExtensionSystem::PluginManager::instance(); const bool success = m_mainWindow->init(m_pm, error_message); if (success) { -#ifdef QT_WEBKIT +#if !defined(QT_NO_WEBKIT) QWebSettings *webSettings = QWebSettings::globalSettings(); const QFont applicationFont = QApplication::font(); webSettings->setFontFamily(QWebSettings::StandardFont, applicationFont.family()); diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index f0c474d4f8f..80056b3b2e5 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -163,7 +163,6 @@ FORMS += dialogs/newdialog.ui \ RESOURCES += core.qrc \ fancyactionbar.qrc -contains(QT_CONFIG, webkit): { +contains(QT_CONFIG, webkit) { QT += webkit - DEFINES += QT_WEBKIT } diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index e6c69c0001c..42b67d7a8b8 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -36,7 +36,7 @@ #include "coreimpl.h" #include "modemanager.h" -#ifdef QT_WEBKIT +#if !defined(QT_NO_WEBKIT) #include <QtWebKit/QWebView> #include <QtGui/QApplication> #include <QtCore/QFileInfo> @@ -69,7 +69,7 @@ struct WelcomeModePrivate { WelcomeModePrivate(); QWidget *m_widget; -#ifdef QT_WEBKIT +#if !defined(QT_NO_WEBKIT) QWebView *m_webview; #else QLabel *m_label; @@ -85,7 +85,7 @@ struct WelcomeModePrivate { WelcomeModePrivate::WelcomeModePrivate() : m_widget(new QWidget), -#ifdef QT_WEBKIT +#if !defined(QT_NO_WEBKIT) m_webview(new QWebView), #else m_label(new QLabel), @@ -97,7 +97,7 @@ WelcomeModePrivate::WelcomeModePrivate() : { } -#ifndef QT_WEBKIT +#if defined(QT_NO_WEBKIT) const char *LABEL = "<center><table><tr><td><img src=\":/qworkbench/html/images/product_logo.png\"/></td><td width=300>" "<h2><br/><br/>Welcome</h2><p> Qt Creator is an intuitive, modern cross platform IDE that enables " @@ -142,7 +142,7 @@ WelcomeMode::WelcomeMode() : l->setMargin(0); l->setSpacing(0); l->addWidget(new QToolBar(m_d->m_widget)); -#ifdef QT_WEBKIT +#if !defined(QT_NO_WEBKIT) connect(m_d->m_webview, SIGNAL(linkClicked(QUrl)), this, SLOT(linkClicked(QUrl))); WelcomePageData welcomePageData; @@ -199,7 +199,7 @@ void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData) { // should really only modify the DOM tree -#ifndef QT_WEBKIT +#if defined(QT_NO_WEBKIT) Q_UNUSED(welcomePageData); #else diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index 6c63c28b1ea..2e3aa2bc61b 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -296,7 +296,7 @@ void CentralWidget::print() initPrinter(); QPrintDialog *dlg = new QPrintDialog(printer, this); -#if !defined(USE_WEBKIT) +#if defined(QT_NO_WEBKIT) if (viewer->textCursor().hasSelection()) dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection); #endif @@ -414,7 +414,7 @@ HelpViewer *CentralWidget::newEmptyTab() HelpViewer* viewer = new HelpViewer(helpEngine, this); viewer->installEventFilter(this); viewer->setFocus(Qt::OtherFocusReason); -#if !defined(USE_WEBKIT) +#if defined(QT_NO_WEBKIT) viewer->setDocumentTitle(tr("unknown")); #endif tabWidget->setCurrentIndex(tabWidget->addTab(viewer, tr("unknown"))); @@ -465,7 +465,7 @@ void CentralWidget::setTabTitle(const QUrl& url) int tab = lastTabPage; HelpViewer* viewer = currentHelpViewer(); -#if defined(USE_WEBKIT) +#if !defined(QT_NO_WEBKIT) if (!viewer || viewer->source() != url) { QTabBar *tabBar = qFindChild<QTabBar*>(tabWidget); for (tab = 0; tab < tabBar->count(); ++tab) { @@ -611,7 +611,7 @@ bool CentralWidget::find(const QString &txt, QTextDocument::FindFlags findFlags, { HelpViewer* viewer = currentHelpViewer(); -#if defined(USE_WEBKIT) +#if !defined(QT_NO_WEBKIT) Q_UNUSED(incremental); if (viewer) { QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; diff --git a/src/plugins/help/help.pro b/src/plugins/help/help.pro index a7de200f743..1148606cab7 100644 --- a/src/plugins/help/help.pro +++ b/src/plugins/help/help.pro @@ -30,7 +30,7 @@ FORMS += docsettingspage.ui \ filtersettingspage.ui RESOURCES += help.qrc include(../../../shared/help/help.pri) -contains(QT_CONFIG, webkit) { - DEFINES += USE_WEBKIT + +contains(QT_CONFIG, webkit) { QT += webkit } diff --git a/src/plugins/help/helpfindsupport.cpp b/src/plugins/help/helpfindsupport.cpp index 306a1d5f40b..2f8da0e4599 100644 --- a/src/plugins/help/helpfindsupport.cpp +++ b/src/plugins/help/helpfindsupport.cpp @@ -54,7 +54,7 @@ QString HelpFindSupport::currentFindString() const HelpViewer* viewer = m_centralWidget->currentHelpViewer(); if (!viewer) return QString(); -#if defined(USE_WEBKIT) +#if !defined(QT_NO_WEBKIT) return viewer->selectedText(); #else return viewer->textCursor().selectedText(); -- GitLab