Move theme detection into Application

* Add function to Application to quickly determine if in light or dark theme
* Add kpxcApp symbol
* Explicitly define main function for GUI tests to improve performance and use custom Application.
This commit is contained in:
Jonathan White
2020-03-08 22:45:51 -04:00
parent a8c02fdc3c
commit 1d7ef5d4eb
7 changed files with 77 additions and 30 deletions

View File

@@ -41,6 +41,7 @@ public:
bool event(QEvent* event) override;
bool isAlreadyRunning() const;
bool isDarkTheme() const;
bool sendFileNamesToRunningInstance(const QStringList& fileNames);
@@ -68,6 +69,7 @@ private:
static int unixSignalSocket[2];
#endif
bool m_alreadyRunning;
bool m_darkTheme = false;
QLockFile* m_lockFile;
QLocalServer m_lockServer;
QString m_socketName;
@@ -76,4 +78,6 @@ private:
#endif
};
#define kpxcApp qobject_cast<Application*>(Application::instance())
#endif // KEEPASSX_APPLICATION_H