From 516ddb22ae2c05e35401b0a5a6d81d93fc3d5ea1 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Fri, 21 Jul 2023 17:58:48 +0100 Subject: [PATCH] More catpack changes :3 This is just embarrasing Signed-off-by: TheKodeToad --- launcher/ui/themes/ThemeManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/launcher/ui/themes/ThemeManager.cpp b/launcher/ui/themes/ThemeManager.cpp index fc7c3649b..46fe0b25d 100644 --- a/launcher/ui/themes/ThemeManager.cpp +++ b/launcher/ui/themes/ThemeManager.cpp @@ -62,7 +62,10 @@ ITheme* ThemeManager::getTheme(QString themeId) QString ThemeManager::addIconTheme(IconTheme theme) { QString id = theme.id(); - m_icons.emplace(id, std::move(theme)); + if (m_icons.find(id) == m_icons.end()) + m_icons.emplace(id, std::move(theme)); + else + themeWarningLog() << "IconTheme(" << id << ") not added to prevent id duplication"; return id; } @@ -129,7 +132,7 @@ void ThemeManager::initializeWidgets() themeWarningLog() << "Couldn't create theme folder"; themeDebugLog() << "Theme Folder Path: " << m_applicationThemeFolder.absolutePath(); - QDirIterator directoryIterator(m_applicationThemeFolder.path(), QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories); + QDirIterator directoryIterator(m_applicationThemeFolder.path(), QDir::Dirs | QDir::NoDotAndDotDot); while (directoryIterator.hasNext()) { QDir dir(directoryIterator.next()); QFileInfo themeJson(dir.absoluteFilePath("theme.json"));