Correctly separate webengine-only code.
This commit is contained in:
parent
e41dbbfe41
commit
15e83ebd8f
3 changed files with 17 additions and 1 deletions
|
@ -62,13 +62,16 @@
|
||||||
|
|
||||||
FormMain::FormMain(QWidget *parent, Qt::WindowFlags f)
|
FormMain::FormMain(QWidget *parent, Qt::WindowFlags f)
|
||||||
: QMainWindow(parent, f), m_ui(new Ui::FormMain) {
|
: QMainWindow(parent, f), m_ui(new Ui::FormMain) {
|
||||||
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
#if defined(USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
m_adblockIcon = new AdBlockIcon(this);
|
m_adblockIcon = new AdBlockIcon(this);
|
||||||
m_adblockIconAction = m_adblockIcon->menuAction();
|
m_adblockIconAction = m_adblockIcon->menuAction();
|
||||||
m_adblockIconAction->setObjectName(QSL("m_adblockIconAction"));
|
m_adblockIconAction->setObjectName(QSL("m_adblockIconAction"));
|
||||||
|
|
||||||
|
m_ui->m_menuTools->addAction(m_adblockIconAction);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_ui->setupUi(this);
|
|
||||||
qApp->setMainForm(this);
|
qApp->setMainForm(this);
|
||||||
|
|
||||||
// Add these actions to the list of actions of the main window.
|
// Add these actions to the list of actions of the main window.
|
||||||
|
|
|
@ -49,7 +49,9 @@
|
||||||
|
|
||||||
Application::Application(const QString &id, int &argc, char **argv)
|
Application::Application(const QString &id, int &argc, char **argv)
|
||||||
: QtSingleApplication(id, argc, argv),
|
: QtSingleApplication(id, argc, argv),
|
||||||
|
#if defined(USE_WEBENGINE)
|
||||||
m_urlInterceptor(new NetworkUrlInterceptor(this)),
|
m_urlInterceptor(new NetworkUrlInterceptor(this)),
|
||||||
|
#endif
|
||||||
m_feedReader(nullptr),
|
m_feedReader(nullptr),
|
||||||
m_updateFeedsLock(nullptr), m_userActions(QList<QAction*>()), m_mainForm(nullptr),
|
m_updateFeedsLock(nullptr), m_userActions(QList<QAction*>()), m_mainForm(nullptr),
|
||||||
m_trayIcon(nullptr), m_settings(nullptr), m_system(nullptr), m_skins(nullptr),
|
m_trayIcon(nullptr), m_settings(nullptr), m_system(nullptr), m_skins(nullptr),
|
||||||
|
@ -322,9 +324,11 @@ SystemTrayIcon *Application::trayIcon() {
|
||||||
return m_trayIcon;
|
return m_trayIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(USE_WEBENGINE)
|
||||||
NetworkUrlInterceptor *Application::urlIinterceptor() {
|
NetworkUrlInterceptor *Application::urlIinterceptor() {
|
||||||
return m_urlInterceptor;
|
return m_urlInterceptor;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void Application::showTrayIcon() {
|
void Application::showTrayIcon() {
|
||||||
qDebug("Showing tray icon.");
|
qDebug("Showing tray icon.");
|
||||||
|
|
|
@ -47,7 +47,10 @@ class QAction;
|
||||||
class Mutex;
|
class Mutex;
|
||||||
class QWebEngineDownloadItem;
|
class QWebEngineDownloadItem;
|
||||||
class FeedReader;
|
class FeedReader;
|
||||||
|
|
||||||
|
#if defined(USE_WEBENGINE)
|
||||||
class NetworkUrlInterceptor;
|
class NetworkUrlInterceptor;
|
||||||
|
#endif
|
||||||
|
|
||||||
class Application : public QtSingleApplication {
|
class Application : public QtSingleApplication {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -80,7 +83,10 @@ class Application : public QtSingleApplication {
|
||||||
FormMain *mainForm();
|
FormMain *mainForm();
|
||||||
QWidget *mainFormWidget();
|
QWidget *mainFormWidget();
|
||||||
SystemTrayIcon *trayIcon();
|
SystemTrayIcon *trayIcon();
|
||||||
|
|
||||||
|
#if defined(USE_WEBENGINE)
|
||||||
NetworkUrlInterceptor *urlIinterceptor();
|
NetworkUrlInterceptor *urlIinterceptor();
|
||||||
|
#endif
|
||||||
|
|
||||||
QString getTempFolderPath();
|
QString getTempFolderPath();
|
||||||
QString getDocumentsFolderPath();
|
QString getDocumentsFolderPath();
|
||||||
|
@ -158,7 +164,10 @@ class Application : public QtSingleApplication {
|
||||||
// action will be allowed to lock for reading.
|
// action will be allowed to lock for reading.
|
||||||
QScopedPointer<Mutex> m_updateFeedsLock;
|
QScopedPointer<Mutex> m_updateFeedsLock;
|
||||||
|
|
||||||
|
#if defined(USE_WEBENGINE)
|
||||||
NetworkUrlInterceptor *m_urlInterceptor;
|
NetworkUrlInterceptor *m_urlInterceptor;
|
||||||
|
#endif
|
||||||
|
|
||||||
QList<QAction*> m_userActions;
|
QList<QAction*> m_userActions;
|
||||||
FormMain *m_mainForm;
|
FormMain *m_mainForm;
|
||||||
SystemTrayIcon *m_trayIcon;
|
SystemTrayIcon *m_trayIcon;
|
||||||
|
|
Loading…
Add table
Reference in a new issue