diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index eb835c648..a3a0f72b7 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -167,6 +167,7 @@ Gtk::TreeIter ProfilePanel::getLastSavedRow() Gtk::TreeIter ProfilePanel::addCustomRow() { if(customPSE) { + profiles->deleteRow(customPSE); delete customPSE; customPSE = nullptr; } @@ -179,6 +180,7 @@ Gtk::TreeIter ProfilePanel::addCustomRow() Gtk::TreeIter ProfilePanel::addLastSavedRow() { if(lastSavedPSE) { + profiles->deleteRow(lastSavedPSE); delete lastSavedPSE; lastSavedPSE = nullptr; } diff --git a/rtgui/profilestorecombobox.cc b/rtgui/profilestorecombobox.cc index b4e893c1d..e7d64f28b 100644 --- a/rtgui/profilestorecombobox.cc +++ b/rtgui/profilestorecombobox.cc @@ -356,3 +356,11 @@ Gtk::TreeIter ProfileStoreComboBox::addRow (const ProfileStoreEntry *profileStor return newEntry; } +/** @brief Delete a row from the first level of the tree */ +void ProfileStoreComboBox::deleteRow (const ProfileStoreEntry *profileStoreEntry) +{ + Gtk::TreeIter entry = findRowFromEntry(profileStoreEntry); + if (entry) { + refTreeModel->erase(entry); + } +} diff --git a/rtgui/profilestorecombobox.h b/rtgui/profilestorecombobox.h index 111e767c2..9c31ad60a 100644 --- a/rtgui/profilestorecombobox.h +++ b/rtgui/profilestorecombobox.h @@ -90,6 +90,7 @@ public: bool setInternalEntry (); Gtk::TreeIter getRowFromLabel (Glib::ustring name); Gtk::TreeIter addRow (const ProfileStoreEntry *profileStoreEntry); + void deleteRow (const ProfileStoreEntry *profileStoreEntry); }; #endif