From 15e83ebd8fb05943bb79d9fd81daae7aafb30d28 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 20 Jul 2017 12:36:56 +0200 Subject: [PATCH] Correctly separate webengine-only code. --- src/gui/dialogs/formmain.cpp | 5 ++++- src/miscellaneous/application.cpp | 4 ++++ src/miscellaneous/application.h | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/formmain.cpp b/src/gui/dialogs/formmain.cpp index b9a7e8ff2..9ebfb63e4 100755 --- a/src/gui/dialogs/formmain.cpp +++ b/src/gui/dialogs/formmain.cpp @@ -62,13 +62,16 @@ FormMain::FormMain(QWidget *parent, Qt::WindowFlags f) : QMainWindow(parent, f), m_ui(new Ui::FormMain) { + m_ui->setupUi(this); + #if defined(USE_WEBENGINE) m_adblockIcon = new AdBlockIcon(this); m_adblockIconAction = m_adblockIcon->menuAction(); m_adblockIconAction->setObjectName(QSL("m_adblockIconAction")); + + m_ui->m_menuTools->addAction(m_adblockIconAction); #endif - m_ui->setupUi(this); qApp->setMainForm(this); // Add these actions to the list of actions of the main window. diff --git a/src/miscellaneous/application.cpp b/src/miscellaneous/application.cpp index c93deaade..b7d8b67ea 100755 --- a/src/miscellaneous/application.cpp +++ b/src/miscellaneous/application.cpp @@ -49,7 +49,9 @@ Application::Application(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv), + #if defined(USE_WEBENGINE) m_urlInterceptor(new NetworkUrlInterceptor(this)), + #endif m_feedReader(nullptr), m_updateFeedsLock(nullptr), m_userActions(QList()), m_mainForm(nullptr), m_trayIcon(nullptr), m_settings(nullptr), m_system(nullptr), m_skins(nullptr), @@ -322,9 +324,11 @@ SystemTrayIcon *Application::trayIcon() { return m_trayIcon; } +#if defined(USE_WEBENGINE) NetworkUrlInterceptor *Application::urlIinterceptor() { return m_urlInterceptor; } +#endif void Application::showTrayIcon() { qDebug("Showing tray icon."); diff --git a/src/miscellaneous/application.h b/src/miscellaneous/application.h index 11eaac4f9..3c797e5c8 100755 --- a/src/miscellaneous/application.h +++ b/src/miscellaneous/application.h @@ -47,7 +47,10 @@ class QAction; class Mutex; class QWebEngineDownloadItem; class FeedReader; + +#if defined(USE_WEBENGINE) class NetworkUrlInterceptor; +#endif class Application : public QtSingleApplication { Q_OBJECT @@ -80,7 +83,10 @@ class Application : public QtSingleApplication { FormMain *mainForm(); QWidget *mainFormWidget(); SystemTrayIcon *trayIcon(); + +#if defined(USE_WEBENGINE) NetworkUrlInterceptor *urlIinterceptor(); +#endif QString getTempFolderPath(); QString getDocumentsFolderPath(); @@ -158,7 +164,10 @@ class Application : public QtSingleApplication { // action will be allowed to lock for reading. QScopedPointer m_updateFeedsLock; +#if defined(USE_WEBENGINE) NetworkUrlInterceptor *m_urlInterceptor; +#endif + QList m_userActions; FormMain *m_mainForm; SystemTrayIcon *m_trayIcon;