CVirtualDirectoryTreeView: Make use of QSignalBlocker()
Same behavior, but automatically releases blocked signals.
This commit is contained in:
parent
fc4c0a6c58
commit
a65af0dd22
|
@ -68,10 +68,11 @@ void CVirtualDirectoryTreeView::OnDirectoryMoved(const CVirtualDirectory *pDir)
|
||||||
|
|
||||||
const QModelIndex Index = mpModel->GetIndexForDirectory(pDir);
|
const QModelIndex Index = mpModel->GetIndexForDirectory(pDir);
|
||||||
|
|
||||||
blockSignals(true);
|
{
|
||||||
expand(Index.parent());
|
[[maybe_unused]] const QSignalBlocker blocker{this};
|
||||||
selectionModel()->setCurrentIndex(Index, QItemSelectionModel::ClearAndSelect);
|
expand(Index.parent());
|
||||||
blockSignals(false);
|
selectionModel()->setCurrentIndex(Index, QItemSelectionModel::ClearAndSelect);
|
||||||
|
}
|
||||||
|
|
||||||
mTransferSelectionPostMove = false;
|
mTransferSelectionPostMove = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue