Qt: Keep profile selection when renamed

Keep the list selection when renaming a profile in the
Profiles dialog.

Bug: 15966
Change-Id: Ifda223b2286ef49ba46830954872e9303e27a089
Reviewed-on: https://code.wireshark.org/review/36322
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2020-03-06 21:40:17 +01:00
parent 40b8293d43
commit 2e2b537381
1 changed files with 2 additions and 2 deletions

View File

@ -530,13 +530,13 @@ void ProfileDialog::on_buttonBox_helpRequested()
wsApp->helpTopicAction(HELP_CONFIG_PROFILES_DIALOG);
}
void ProfileDialog::dataChanged(const QModelIndex &idx)
void ProfileDialog::dataChanged(const QModelIndex &)
{
pd_ui_->lineProfileFilter->setText("");
pd_ui_->cmbProfileTypes->setCurrentIndex(ProfileSortModel::AllProfiles);
pd_ui_->profileTreeView->setFocus();
if (! idx.isValid() && model_->lastSetRow() >= 0)
if (model_->lastSetRow() >= 0)
{
QModelIndex original = model_->index(model_->lastSetRow(), ProfileModel::COL_NAME);
pd_ui_->profileTreeView->setCurrentIndex(sort_model_->mapFromSource(original));