diff -r 3e92760fe00a -r f7dd937667a5 src/document.cpp --- a/src/document.cpp Thu Feb 27 23:07:40 2020 +0200 +++ b/src/document.cpp Fri Feb 28 19:24:33 2020 +0200 @@ -58,17 +58,12 @@ connect(this->ui.listView->selectionModel(), &QItemSelectionModel::selectionChanged, [&](const QItemSelection& selected, const QItemSelection& deselected) { - QSet selectedIds; - QSet deselectedIds; - for (const QModelIndex& index : selected.indexes()) + auto resolveIndex = [this](const QModelIndex& index){ return this->model->resolve(index); }; + auto resolve = [resolveIndex](const QItemSelection& selection) { - selectedIds.insert(this->model->resolve(index)); - } - for (const QModelIndex& index : deselected.indexes()) - { - deselectedIds.insert(this->model->resolve(index)); - } - this->renderer->handleSelectionChange(selectedIds, deselectedIds); + return fn::map>(selection.indexes(), resolveIndex); + }; + this->renderer->handleSelectionChange(resolve(selected), resolve(deselected)); }); }