mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Preserve the current index in History list when a single entry is deleted.
This commit is contained in:
parent
4d5665d816
commit
7065809566
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue