From: Marcus Eggenberger Date: Mon, 18 Feb 2008 23:14:29 +0000 (+0000) Subject: last fix for buffer removal (fingers crossed). It is strongly discouraged to use... X-Git-Tag: 0.2.0-alpha1~34 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=87f95344178f652061d2c27ad6eda60d738a2041 last fix for buffer removal (fingers crossed). It is strongly discouraged to use r543 to r545. --- diff --git a/src/client/client.cpp b/src/client/client.cpp index d57678dd..be2c8940 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -464,6 +464,14 @@ void Client::setBufferLastSeen(BufferId id, const QDateTime &lastSeen) { } void Client::bufferRemoved(BufferId bufferId) { + QModelIndex current = bufferModel()->currentIndex(); + if(current.data(NetworkModel::BufferIdRole).value() == bufferId) { + // select the status buffer if the currently displayed buffer is about to be removed + QModelIndex newCurrent = current.sibling(0,0); + bufferModel()->standardSelectionModel()->setCurrentIndex(newCurrent, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + bufferModel()->standardSelectionModel()->select(newCurrent, QItemSelectionModel::ClearAndSelect); + } + networkModel()->removeBuffer(bufferId); if(_buffers.contains(bufferId)) { Buffer *buff = _buffers.take(bufferId); diff --git a/version.inc b/version.inc index 528b199d..b9713664 100644 --- a/version.inc +++ b/version.inc @@ -5,7 +5,7 @@ quasselVersion = "0.2.0-pre"; quasselDate = "2008-02-18"; - quasselBuild = 545; + quasselBuild = 546; //! Minimum client build number the core needs clientBuildNeeded = 526;