X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffertreemodel.cpp;h=bc2bf0ad21c2bc1930093c4124a23ea2a9e21083;hp=23e368860125120bab737ddba01dbef5c13c9095;hb=90c454909ca9b86d096c18a011f6c10465a672e2;hpb=6250a7e25eb2c0a6794d4aa5679c70082d825031 diff --git a/src/client/buffertreemodel.cpp b/src/client/buffertreemodel.cpp index 23e36886..bc2bf0ad 100644 --- a/src/client/buffertreemodel.cpp +++ b/src/client/buffertreemodel.cpp @@ -286,7 +286,7 @@ bool BufferTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction action, uint bufferId = bufferList.first().second; // no self merges (would kill us) - if(bufferId == parent.data(BufferUidRole).toInt()) + if(bufferId == parent.data(BufferUidRole).toUInt()) return false; Q_ASSERT(rootItem->childById(netId)); @@ -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);