From 53837c0938a7ce08c5066ad766dd5c57b3869e2e 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()