Skip to content

Commit

Permalink
Merge branch 'profile-panel-bugfix' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Hombre57 committed Dec 15, 2018
2 parents ddfc67b + 71a5521 commit cfa3d30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rtgui/profilepanel.cc
Expand Up @@ -167,6 +167,7 @@ Gtk::TreeIter ProfilePanel::getLastSavedRow()
Gtk::TreeIter ProfilePanel::addCustomRow()
{
if(customPSE) {
profiles->deleteRow(customPSE);
delete customPSE;
customPSE = nullptr;
}
Expand All @@ -179,6 +180,7 @@ Gtk::TreeIter ProfilePanel::addCustomRow()
Gtk::TreeIter ProfilePanel::addLastSavedRow()
{
if(lastSavedPSE) {
profiles->deleteRow(lastSavedPSE);
delete lastSavedPSE;
lastSavedPSE = nullptr;
}
Expand Down
8 changes: 8 additions & 0 deletions rtgui/profilestorecombobox.cc
Expand Up @@ -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);
}
}
1 change: 1 addition & 0 deletions rtgui/profilestorecombobox.h
Expand Up @@ -90,6 +90,7 @@ class ProfileStoreComboBox : public MyComboBox
bool setInternalEntry ();
Gtk::TreeIter getRowFromLabel (Glib::ustring name);
Gtk::TreeIter addRow (const ProfileStoreEntry *profileStoreEntry);
void deleteRow (const ProfileStoreEntry *profileStoreEntry);
};

#endif

0 comments on commit cfa3d30

Please sign in to comment.