CVirtualDirectoryTreeView: Make use of QSignalBlocker()

Same behavior, but automatically releases blocked signals.
This commit is contained in:
Lioncash 2020-07-10 10:57:21 -04:00
parent fc4c0a6c58
commit a65af0dd22
1 changed files with 5 additions and 4 deletions

View File

@ -68,10 +68,11 @@ void CVirtualDirectoryTreeView::OnDirectoryMoved(const CVirtualDirectory *pDir)
const QModelIndex Index = mpModel->GetIndexForDirectory(pDir);
blockSignals(true);
expand(Index.parent());
selectionModel()->setCurrentIndex(Index, QItemSelectionModel::ClearAndSelect);
blockSignals(false);
{
[[maybe_unused]] const QSignalBlocker blocker{this};
expand(Index.parent());
selectionModel()->setCurrentIndex(Index, QItemSelectionModel::ClearAndSelect);
}
mTransferSelectionPostMove = false;
}