diff options
Diffstat (limited to 'examples/triage/exports.cpp')
| -rw-r--r-- | examples/triage/exports.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/triage/exports.cpp b/examples/triage/exports.cpp index ad315384..c9f0e42d 100644 --- a/examples/triage/exports.cpp +++ b/examples/triage/exports.cpp @@ -438,15 +438,18 @@ void ExportsTreeView::scrollToCurrentItem() } -void ExportsTreeView::selectFirstItem() +void ExportsTreeView::ensureSelection() { - setCurrentIndex(m_model->index(0, 0, QModelIndex())); + if (auto current = currentIndex(); !current.isValid()) + setCurrentIndex(m_model->index(0, 0, QModelIndex())); } -void ExportsTreeView::activateFirstItem() +void ExportsTreeView::activateSelection() { - exportDoubleClicked(m_model->index(0, 0, QModelIndex())); + ensureSelection(); + if (auto current = currentIndex(); current.isValid()) + exportDoubleClicked(current); } |
