From c030e0d5e910fe8af376e5462c9e58d45fd59e40 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Thu, 7 Feb 2008 17:42:57 +0000 Subject: [PATCH] fixed a bug when selecting a buffer in a different view not resulting in a bufferswitch --- src/client/mappedselectionmodel.cpp | 9 +++------ src/uisupport/inputline.cpp | 2 -- src/uisupport/tabcompleter.cpp | 1 + 3 files changed, 4 insertions(+), 8 deletions(-) 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) { diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index e559a930..c297694c 100644 --- a/src/uisupport/inputline.cpp +++ b/src/uisupport/inputline.cpp @@ -27,8 +27,6 @@ InputLine::InputLine(QWidget *parent) idx(0), tabCompleter(new TabCompleter(this)) { - - installEventFilter(tabCompleter); #ifdef Q_WS_MAC bindModifier = Qt::ControlModifier | Qt::AltModifier; diff --git a/src/uisupport/tabcompleter.cpp b/src/uisupport/tabcompleter.cpp index 68f1532a..8c29e8ab 100644 --- a/src/uisupport/tabcompleter.cpp +++ b/src/uisupport/tabcompleter.cpp @@ -34,6 +34,7 @@ TabCompleter::TabCompleter(InputLine *inputLine_) enabled(false), nickSuffix(": ") { + inputLine->installEventFilter(this); } void TabCompleter::buildCompletionList() { -- 2.20.1