# HG changeset patch # User John W. Eaton # Date 1670343048 18000 # Node ID ab33554f97d25c223cff5a305e0e6fca00ac6e70 # Parent e518e1f7e944da41501ab2c341a55a13ed517b77 fix another error introduced in changeset ad014fc78bd6 * gui-settings.cc (gui_settings::config_icon_theme): Use value of global_all_icon_themes from settings if it exists. diff -r e518e1f7e944 -r ab33554f97d2 libgui/src/gui-settings.cc --- a/libgui/src/gui-settings.cc Mon Dec 05 10:17:17 2022 -0500 +++ b/libgui/src/gui-settings.cc Tue Dec 06 11:10:48 2022 -0500 @@ -135,27 +135,32 @@ void gui_settings::config_icon_theme (void) { - int theme = global_icon_theme_index.def.toInt (); + int theme_index; - // check for new and old setting and use old if required - if (! contains (global_icon_theme_index.key)) + if (contains (global_icon_theme_index.key)) + theme_index = value (global_icon_theme_index).toInt (); + else { - // new pref does not exist + // New pref does not exist. Use old if required. Add new and + // remove deprecated key. + if (value (global_icon_theme).toBool ()) - theme = ICON_THEME_SYSTEM; + theme_index = ICON_THEME_SYSTEM; else - theme = ICON_THEME_OCTAVE; - setValue (global_icon_theme_index.key, theme); // add new - remove (global_icon_theme.key); // remove deprecated key + theme_index = ICON_THEME_OCTAVE; + + setValue (global_icon_theme_index.key, theme_index); + remove (global_icon_theme.key); } - QIcon::setThemeName (global_all_icon_themes.at (theme)); + QIcon::setThemeName (global_all_icon_themes.at (theme_index)); - QStringList icon_fallbacks; + QStringList icon_fallbacks; - // set the required fallback search paths - switch (theme) - { + // Set the required fallback search paths. + + switch (theme_index) + { case ICON_THEME_SYSTEM: icon_fallbacks << global_icon_paths.at (ICON_THEME_OCTAVE); icon_fallbacks << global_icon_paths.at (ICON_THEME_TANGO); @@ -166,7 +171,7 @@ case ICON_THEME_OCTAVE: icon_fallbacks << global_icon_paths.at (ICON_THEME_TANGO); break; - } + } icon_fallbacks << global_icon_paths.at (ICON_THEME_CURSORS);