From d8e41eaeaa1568f2b76541fe16984c9e7b98b7d2 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Sat, 27 Feb 2016 09:44:14 +0100 Subject: [PATCH] Fix #3711 by using the method to clear a combo box which is correct in version 2 and 3 of Gtk+. --- rtgui/preferences.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 78547e9d7..b4231744e 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1950,18 +1950,17 @@ void Preferences::bundledProfilesChanged () void Preferences::iccDirChanged () { - const Glib::ustring currentSelection = monProfile->get_active_text (); + const auto currentSelection = monProfile->get_active_text (); + const auto profiles = rtengine::ICCStore::getInstance ()->getProfilesFromDir (iccDir->get_filename ()); - monProfile->clear(); + monProfile->remove_all(); - monProfile->append_text (M("PREFERENCES_PROFILE_NONE")); - monProfile->set_active (0); + monProfile->append (M("PREFERENCES_PROFILE_NONE")); - const std::vector profiles = rtengine::ICCStore::getInstance ()->getProfilesFromDir (iccDir->get_filename ()); - for (std::vector::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile) - monProfile->append_text (*profile); + for (const auto& profile : profiles) + monProfile->append (profile); - monProfile->set_active_text (currentSelection); + setActiveTextOrIndex(*monProfile, currentSelection, 0); } void Preferences::storeCurrentValue()