Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit c2d1f47f authored by David Faure's avatar David Faure

Only select if not already selected

QItemSelectionModel doesn't check this, and unselects+selects again,
triggering many changed signals for nothing.

Original idea and review by Christian Mollekopf
parent 60dc7a18
......@@ -127,7 +127,7 @@ public:
void select(const Collection::Id &collectionId)
const QModelIndex index = EntityTreeModel::modelIndexForCollection(q->sourceModel(), Collection(collectionId));
if (index.isValid()) {
if (index.isValid() && !q->selectionModel()->isSelected(index)) {
q->selectionModel()->select(index, QItemSelectionModel::Select);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment