Preserve the current index in History list when a single entry is deleted.

This commit is contained in:
Tvangeste 2013-01-17 16:11:06 +01:00
parent 4d5665d816
commit 7065809566

View file

@ -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
{