Qt: Fix profile copy with wrong profile name

Bug: 15967
Change-Id: Ifda13a517fdcfd5a34fd298f08d0714e36301a91
Reviewed-on: https://code.wireshark.org/review/34187
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Roland Knall 2019-08-05 14:00:32 +02:00
parent 353a2dabb0
commit 24e43bf542
1 changed files with 8 additions and 1 deletions

View File

@ -605,7 +605,14 @@ QModelIndex ProfileModel::duplicateEntry(QModelIndex idx, int new_status)
parent = prof->reference;
QString parentName = parent;
if ( prof->status == PROF_STAT_CHANGED )
if ( prof->status == PROF_STAT_COPY )
{
int row = findByNameAndVisibility(parentName, false, true);
profile_def * par = guard(row);
if ( par && par->status == PROF_STAT_CHANGED )
parentName = par->name;
}
else if ( prof->status == PROF_STAT_CHANGED )
parentName = prof->name;
if ( parent.length() == 0 )