Fix #3711 by using the method to clear a combo box which is correct in version 2 and 3 of Gtk+.

This commit is contained in:
Adam Reichold
2016-02-27 09:44:14 +01:00
parent 43c316f43b
commit d8e41eaeaa

View File

@@ -1950,18 +1950,17 @@ void Preferences::bundledProfilesChanged ()
void Preferences::iccDirChanged () 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->append (M("PREFERENCES_PROFILE_NONE"));
monProfile->set_active (0);
const std::vector<Glib::ustring> profiles = rtengine::ICCStore::getInstance ()->getProfilesFromDir (iccDir->get_filename ()); for (const auto& profile : profiles)
for (std::vector<Glib::ustring>::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile) monProfile->append (profile);
monProfile->append_text (*profile);
monProfile->set_active_text (currentSelection); setActiveTextOrIndex(*monProfile, currentSelection, 0);
} }
void Preferences::storeCurrentValue() void Preferences::storeCurrentValue()