From 70658095663733903593a62e8330ca79eacc3880 Mon Sep 17 00:00:00 2001 From: Tvangeste Date: Thu, 17 Jan 2013 16:11:06 +0100 Subject: [PATCH] Preserve the current index in History list when a single entry is deleted. --- historypanewidget.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/historypanewidget.cc b/historypanewidget.cc index 42335e2f..8120edb8 100644 --- a/historypanewidget.cc +++ b/historypanewidget.cc @@ -135,12 +135,13 @@ void HistoryPaneWidget::deleteSelectedItems() while ( idxs.hasNext() ) m_history->removeItem( idxs.next() ); - if (idxsToDelete.size() == 1) + if ( idxsToDelete.size() == 1 ) { // We've just removed a single entry, // keep the selection at the same index. + m_historyList->setCurrentIndex(selectedIdxs.front()); m_historyList->selectionModel()->select( - selectedIdxs.front(), QItemSelectionModel::Select ); + selectedIdxs.front(), QItemSelectionModel::SelectCurrent ); } else {