fixed a bug when selecting a buffer in a different view not resulting in a bufferswitch
authorMarcus Eggenberger <egs@quassel-irc.org>
Thu, 7 Feb 2008 17:42:57 +0000 (17:42 +0000)
committerMarcus Eggenberger <egs@quassel-irc.org>
Thu, 7 Feb 2008 17:42:57 +0000 (17:42 +0000)
src/client/mappedselectionmodel.cpp
src/uisupport/inputline.cpp
src/uisupport/tabcompleter.cpp

index e632581..99b1e4f 100644 (file)
@@ -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 &current, 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) {
index e559a93..c297694 100644 (file)
@@ -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;
index 68f1532..8c29e8a 100644 (file)
@@ -34,6 +34,7 @@ TabCompleter::TabCompleter(InputLine *inputLine_)
     enabled(false),
     nickSuffix(": ")
 {
+  inputLine->installEventFilter(this);
 }
 
 void TabCompleter::buildCompletionList() {