X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fmappedselectionmodel.cpp;h=99b1e4fdbbf72467f0f6b4290fe1b5829ec56b43;hb=997a62b68d7469a93f373476dd955c44eb051be0;hp=e6325810a5daaaaf901f34e5a462d4c4815967c6;hpb=d28b9ec38b6ea0bc473200fc2f1e65abd1b56bd6;p=quassel.git diff --git a/src/client/mappedselectionmodel.cpp b/src/client/mappedselectionmodel.cpp index e6325810..99b1e4fd 100644 --- a/src/client/mappedselectionmodel.cpp +++ b/src/client/mappedselectionmodel.cpp @@ -93,17 +93,14 @@ void MappedSelectionModel::mappedSetCurrentIndex(const QModelIndex &index, QItem QModelIndex mappedIndex = mapFromSource(index); if(mappedIndex == currentIndex()) return; - - if(mappedIndex.isValid()) - setCurrentIndex(mappedIndex, command); - else if(hasSelection()) - setCurrentIndex(currentIndex(), QItemSelectionModel::Clear); + setCurrentIndex(mappedIndex, command); } void MappedSelectionModel::_currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { Q_UNUSED(previous) - emit mappedCurrentChanged(mapToSource(current)); + if(current.isValid()) + emit mappedCurrentChanged(mapToSource(current)); } void MappedSelectionModel::_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) {