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:
@@ -41,7 +41,7 @@ static const QMap<QString, QString> deprecationMap = {
|
||||
{QStringLiteral("security/IconDownloadFallbackToGoogle"), QStringLiteral("security/IconDownloadFallback")},
|
||||
};
|
||||
|
||||
Config* Config::m_instance(nullptr);
|
||||
QPointer<Config> Config::m_instance(nullptr);
|
||||
|
||||
QVariant Config::get(const QString& key)
|
||||
{
|
||||
@@ -246,13 +246,17 @@ Config* Config::instance()
|
||||
|
||||
void Config::createConfigFromFile(const QString& file)
|
||||
{
|
||||
Q_ASSERT(!m_instance);
|
||||
if (m_instance) {
|
||||
delete m_instance;
|
||||
}
|
||||
m_instance = new Config(file, qApp);
|
||||
}
|
||||
|
||||
void Config::createTempFileInstance()
|
||||
{
|
||||
Q_ASSERT(!m_instance);
|
||||
if (m_instance) {
|
||||
delete m_instance;
|
||||
}
|
||||
auto* tmpFile = new QTemporaryFile();
|
||||
bool openResult = tmpFile->open();
|
||||
Q_ASSERT(openResult);
|
||||
|
||||
Reference in New Issue
Block a user