Don't use getIApp()->getPaths() in Theme

This commit is contained in:
Rasmus Karlsson 2024-01-16 21:30:36 +01:00
parent 78c028d4e0
commit d46b553c53
2 changed files with 4 additions and 4 deletions

View file

@ -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<std::pair<QString, QVariant>> 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))
{

View file

@ -169,7 +169,7 @@ private:
*
* NOTE: This is currently not built to be reloadable
**/
void loadAvailableThemes();
void loadAvailableThemes(const Paths &paths);
std::optional<ThemeDescriptor> findThemeByKey(const QString &key);