@@ -167,9 +167,7 @@ static std::optional<std::vector<std::string>> getIconThemeDirs() {
167167 return paths;
168168}
169169
170- static void parseThemes (const std::vector<std::string>& themeDirs, std::vector<std::string>& lookupDirs);
171-
172- static void parseTheme (const std::string& themeDir, std::vector<std::string>& lookupDirs) {
170+ void CSystemIconFactory::parseTheme (const std::string& themeDir) {
173171 const auto THEME_DATA = readFileAsString (themeDir + " /index.theme" );
174172
175173 if (!THEME_DATA )
@@ -190,7 +188,7 @@ static void parseTheme(const std::string& themeDir, std::vector<std::string>& lo
190188 CConstVarList dirs (directoriesList, 0 , ' ,' , true );
191189
192190 for (const auto & d : dirs) {
193- lookupDirs .emplace_back (BASE_PATH / d);
191+ m_lookupPaths .emplace_back (BASE_PATH / d);
194192 }
195193
196194 g_logger->log (HT_LOG_TRACE , " CSystemIconFactory: theme {} has {} dirs" , themeDir, dirs.size ());
@@ -211,19 +209,22 @@ static void parseTheme(const std::string& themeDir, std::vector<std::string>& lo
211209 g_logger->log (HT_LOG_TRACE , " CSystemIconFactory: theme {} inherits {} themes" , themeDir, inherits.size ());
212210
213211 for (const auto & inheritName : inherits) {
212+ if (inheritName == " hicolor" )
213+ m_hicolorAdded = true ;
214+
214215 auto inheritTheme = getThemeDir (trim (std::string{inheritName}));
215216 if (inheritTheme) {
216217 g_logger->log (HT_LOG_TRACE , " CSystemIconFactory: parsing inherited theme {}" , *inheritTheme);
217- parseThemes (*inheritTheme, lookupDirs );
218+ parseThemes (*inheritTheme);
218219 } else
219220 g_logger->log (HT_LOG_WARNING , " CSystemIconFactory: inherited theme {} not found" , std::string{inheritName});
220221 }
221222 }
222223}
223224
224- static void parseThemes (const std::vector<std::string>& themeDirs, std::vector<std::string>& lookupDirs ) {
225+ void CSystemIconFactory:: parseThemes (const std::vector<std::string>& themeDirs) {
225226 for (const auto & td : themeDirs) {
226- parseTheme (td, lookupDirs );
227+ parseTheme (td);
227228 }
228229}
229230
@@ -233,7 +234,13 @@ CSystemIconFactory::CSystemIconFactory() {
233234 if (!baseThemeDir)
234235 return ;
235236
236- parseThemes (baseThemeDir.value (), m_lookupPaths);
237+ parseThemes (baseThemeDir.value ());
238+
239+ if (!m_hicolorAdded) {
240+ const auto DIRS = getThemeDir (" hicolor" );
241+ if (DIRS )
242+ parseThemes (*DIRS );
243+ }
237244
238245 g_logger->log (HT_LOG_TRACE , " CSystemIconFactory: initialized with {} lookup paths" , m_lookupPaths.size ());
239246}
0 commit comments