Qt: fix saving exported objects after sorting columns
Avoid assuming an export object's row number is consistent throughout, because the row number can change if the display is filtered or sorted. Instead, look up the index in the model with mapToSource(). Bug: 14545 Change-Id: I61099dfb4f3abc056417eb7d6ffbc7a988553dd8 Reviewed-on: https://code.wireshark.org/review/30388 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
parent
da8e69e158
commit
4a2739ec88
|
@ -145,7 +145,11 @@ void ExportObjectDialog::saveCurrentEntry()
|
|||
{
|
||||
QDir path(wsApp->lastOpenDir());
|
||||
|
||||
QModelIndex current = eo_ui_->objectTree->currentIndex();
|
||||
QModelIndex proxyIndex = eo_ui_->objectTree->currentIndex();
|
||||
if (!proxyIndex.isValid())
|
||||
return;
|
||||
|
||||
QModelIndex current = proxyModel_.mapToSource(proxyIndex);
|
||||
if (!current.isValid())
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue