From: Marcus Eggenberger Date: Wed, 28 Nov 2007 17:06:04 +0000 (+0000) Subject: This should fix the bug, that buffer switches are propagated multiple times X-Git-Tag: 0.1.0~61 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=90c454909ca9b86d096c18a011f6c10465a672e2 This should fix the bug, that buffer switches are propagated multiple times --- diff --git a/src/client/buffertreemodel.cpp b/src/client/buffertreemodel.cpp index 1066c894..bc2bf0ad 100644 --- a/src/client/buffertreemodel.cpp +++ b/src/client/buffertreemodel.cpp @@ -313,8 +313,9 @@ void BufferTreeModel::bufferUpdated(Buffer *buffer) { // This Slot indicates that the user has selected a different buffer in the gui void BufferTreeModel::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) { Q_UNUSED(command) - if(isBufferIndex(index)) { - currentBuffer = getBufferByIndex(index); + Buffer *newCurrentBuffer; + if(isBufferIndex(index) && currentBuffer != (newCurrentBuffer = getBufferByIndex(index))) { + currentBuffer = newCurrentBuffer; bufferActivity(Buffer::NoActivity, currentBuffer); emit bufferSelected(currentBuffer); emit selectionChanged(index);