From d46b553c53529272c04b1e8c2a4e1d2408e01557 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Tue, 16 Jan 2024 21:30:36 +0100 Subject: [PATCH] Don't use getIApp()->getPaths() in Theme --- src/singletons/Theme.cpp | 6 +++--- src/singletons/Theme.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/singletons/Theme.cpp b/src/singletons/Theme.cpp index 6e7d26f21..ba7cbf63e 100644 --- a/src/singletons/Theme.cpp +++ b/src/singletons/Theme.cpp @@ -228,7 +228,7 @@ void Theme::initialize(Settings &settings, const Paths &paths) }, false); - this->loadAvailableThemes(); + this->loadAvailableThemes(paths); this->update(); } @@ -328,11 +328,11 @@ std::vector> Theme::availableThemes() const return packagedThemes; } -void Theme::loadAvailableThemes() +void Theme::loadAvailableThemes(const Paths &paths) { this->availableThemes_ = Theme::builtInThemes; - auto dir = QDir(getIApp()->getPaths().themesDirectory); + auto dir = QDir(paths.themesDirectory); for (const auto &info : dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name)) { diff --git a/src/singletons/Theme.hpp b/src/singletons/Theme.hpp index 46ecea571..034a01b64 100644 --- a/src/singletons/Theme.hpp +++ b/src/singletons/Theme.hpp @@ -169,7 +169,7 @@ private: * * NOTE: This is currently not built to be reloadable **/ - void loadAvailableThemes(); + void loadAvailableThemes(const Paths &paths); std::optional findThemeByKey(const QString &key);