X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferview.cpp;h=f14cff2c89969f3d95db8c3aa5d46e610bfa839a;hp=76bb2971a1bd445ad1f4db846503015b617a94da;hb=e30092afc1803d753914a7ab9fa88bba818de559;hpb=aab02573197e93132c9263df28b23ec718c4e9b4 diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 76bb2971..f14cff2c 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -129,6 +129,11 @@ void BufferView::setModel(QAbstractItemModel *model) } connect(model, SIGNAL(layoutChanged()), this, SLOT(on_layoutChanged())); + + // Make sure collapsation is correct after setting a model + // This might not be needed here, only in BufferView::setFilteredModel(). If issues arise, just + // move down to setFilteredModel (which calls this function). + setExpandedState(); } @@ -329,7 +334,19 @@ void BufferView::on_configChanged() { Q_ASSERT(model()); - // expand all active networks... collapse inactive ones... unless manually changed + // Expand/collapse as needed + setExpandedState(); + + if (config()) { + // update selection to current one + Client::bufferModel()->synchronizeView(this); + } +} + + +void BufferView::setExpandedState() +{ + // Expand all active networks, collapse inactive ones... unless manually changed QModelIndex networkIdx; NetworkId networkId; for (int row = 0; row < model()->rowCount(); row++) { @@ -343,11 +360,6 @@ void BufferView::on_configChanged() setExpandedState(networkIdx); } - - if (config()) { - // update selection to current one - Client::bufferModel()->synchronizeView(this); - } }