From: Marcus Eggenberger Date: Sun, 24 Feb 2008 16:24:32 +0000 (+0000) Subject: - Fixed "ghost-buffers" appearing in the network view X-Git-Tag: 0.2.0-alpha2~22 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=e8903b1f19c183a537d7b31b7fd709dde1a69ef5 - Fixed "ghost-buffers" appearing in the network view - The name of a buffer can no longer be removed from the buffer views --- diff --git a/src/client/client.cpp b/src/client/client.cpp index 70f8735e..a2988ed8 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -161,6 +161,10 @@ Buffer *Client::buffer(BufferInfo bufferInfo) { client, SLOT(bufferDestroyed())); client->_buffers[bufferInfo.bufferId()] = buff; emit client->bufferUpdated(bufferInfo); + + // I don't like this: but currently there isn't really a prettier way: + QModelIndex bufferIdx = networkModel()->bufferIndex(bufferInfo.bufferId()); + bufferModel()->setCurrentIndex(bufferModel()->mapFromSource(bufferIdx)); } Q_ASSERT(buff); return buff; diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 4ac92f3d..9b1b93ca 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -76,7 +76,7 @@ void BufferView::setModel(QAbstractItemModel *model) { QString sectionName; QAction *showSection; - for(int i = 0; i < model->columnCount(); i++) { + for(int i = 1; i < model->columnCount(); i++) { sectionName = (model->headerData(i, Qt::Horizontal, Qt::DisplayRole)).toString(); showSection = new QAction(sectionName, header()); showSection->setCheckable(true); @@ -118,15 +118,6 @@ void BufferView::rowsInserted(const QModelIndex & parent, int start, int end) { update(parent); expand(parent); } - - - // select newly inserted buffers - if(parent.data(NetworkModel::ItemTypeRole) != NetworkModel::NetworkItemType) - return; - - QModelIndex newCurrent = parent.child(end, 0); - selectionModel()->setCurrentIndex(newCurrent, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); - selectionModel()->select(newCurrent, QItemSelectionModel::ClearAndSelect); } void BufferView::toggleHeader(bool checked) { diff --git a/version.inc b/version.inc index 0bd994cb..1a7e6b4c 100644 --- a/version.inc +++ b/version.inc @@ -4,8 +4,8 @@ { using namespace Global; quasselVersion = "0.2.0-alpha1"; - quasselDate = "2008-02-23"; - quasselBuild = 580; + quasselDate = "2008-02-24"; + quasselBuild = 583; //! Minimum client build number the core needs clientBuildNeeded = 563;