From c4ad0d6ffb3df78be3ea137c03ac175955ea64b3 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 11 Jun 2016 17:03:14 +0200 Subject: [PATCH] Changed: Display previous profile after one is deleted --- .../client/ryzom_installer/src/profilesdialog.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp index 18570f5db..ac126a1b6 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp @@ -128,7 +128,7 @@ void CProfilesDialog::displayProfile(int index) void CProfilesDialog::saveProfile(int index) { - if (index < 0) return; + if (index < 0 || index >= m_model->rowCount()) return; CProfile &profile = m_model->getProfiles()[index]; @@ -146,7 +146,14 @@ void CProfilesDialog::deleteProfile(int index) m_model->removeRow(index); - COperationDialog dialog; + // decrement profile index + --index; + + // select row and update content + profilesListView->setCurrentIndex(m_model->index(index, 0)); + displayProfile(index); + + // TODO: delete files for delete profile } void CProfilesDialog::addProfile()