[webview] reduce #defines

This commit is contained in:
Adriaan de Groot 2022-05-04 11:31:25 +02:00
parent f26ff07046
commit a7cf1b18ce
2 changed files with 12 additions and 11 deletions

View File

@ -28,7 +28,7 @@ WebViewStep::WebViewStep( QObject* parent )
#ifdef WEBVIEW_WITH_WEBENGINE #ifdef WEBVIEW_WITH_WEBENGINE
QtWebEngine::initialize(); QtWebEngine::initialize();
#endif #endif
m_view = new C_QWEBVIEW(); m_view = new WebViewWidget();
#ifdef WEBVIEW_WITH_WEBKIT #ifdef WEBVIEW_WITH_WEBKIT
m_view->settings()->setFontFamily( QWebSettings::StandardFont, m_view->settings()->setFontFamily( QWebSettings::StandardFont,
m_view->settings()->fontFamily( QWebSettings::SansSerifFont ) ); m_view->settings()->fontFamily( QWebSettings::SansSerifFont ) );

View File

@ -20,20 +20,21 @@
#include <QVariantMap> #include <QVariantMap>
#ifdef WEBVIEW_WITH_WEBKIT #if defined( WEBVIEW_WITH_WEBKIT ) && defined( WEBVIEW_WITH_WEBENGINE )
#define C_QWEBVIEW QWebView
#endif
#ifdef WEBVIEW_WITH_WEBENGINE
#ifdef C_QWEBVIEW
#error Both WEBENGINE and WEBKIT enabled #error Both WEBENGINE and WEBKIT enabled
#endif #endif
#define C_QWEBVIEW QWebEngineView #if !defined( WEBVIEW_WITH_WEBKIT ) && !defined( WEBVIEW_WITH_WEBENGINE )
#endif
#ifndef C_QWEBVIEW
#error Neither WEBENGINE nor WEBKIT enabled #error Neither WEBENGINE nor WEBKIT enabled
#endif #endif
class C_QWEBVIEW; #ifdef WEBVIEW_WITH_WEBKIT
class QWebView;
using WebViewWidget = QWebView;
#endif
#ifdef WEBVIEW_WITH_WEBENGINE
class QWebEngineView;
using WebViewWidget = QWebEngineView;
#endif
class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep
{ {
@ -60,7 +61,7 @@ public:
void setConfigurationMap( const QVariantMap& configurationMap ) override; void setConfigurationMap( const QVariantMap& configurationMap ) override;
private: private:
C_QWEBVIEW* m_view; WebViewWidget* m_view;
QString m_url; QString m_url;
QString m_prettyName; QString m_prettyName;
}; };