X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fmappedselectionmodel.cpp;h=99b1e4fdbbf72467f0f6b4290fe1b5829ec56b43;hp=e6325810a5daaaaf901f34e5a462d4c4815967c6;hb=c030e0d5e910fe8af376e5462c9e58d45fd59e40;hpb=fdd6c6c1541faf23e8cb0f5889077b5c5dab2ea5 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) {