X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fmappedselectionmodel.cpp;h=99b1e4fdbbf72467f0f6b4290fe1b5829ec56b43;hp=f5b747098beb6de3e21aea2cd9e6cfe22a773059;hb=c030e0d5e910fe8af376e5462c9e58d45fd59e40;hpb=2f05c5d7e94d5e96d2b4bae59140fd3b60a7a62f diff --git a/src/client/mappedselectionmodel.cpp b/src/client/mappedselectionmodel.cpp index f5b74709..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) { @@ -111,4 +108,4 @@ void MappedSelectionModel::_selectionChanged(const QItemSelection &selected, con Q_UNUSED(deselected) emit mappedSelectionChanged(mapSelectionToSource(QItemSelectionModel::selection())); } - +