X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferview.cpp;h=c4529cbf9e4b2bb1986f54c4b932bab4cd1132af;hp=8c26056b1115486dff15ba56e038337c1982d23a;hb=aa40491595ffec54ba340a9850d99dc14d920eb3;hpb=d69da0b56103c347107fb490008b5c6b0d59e3df diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 8c26056b..c4529cbf 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -26,6 +26,8 @@ #include "uisettings.h" +#include "global.h" + /***************************************** * The TreeView showing the Buffers *****************************************/ @@ -115,9 +117,10 @@ void BufferView::keyPressEvent(QKeyEvent *event) { // ensure that newly inserted network nodes are expanded per default void BufferView::rowsInserted(const QModelIndex & parent, int start, int end) { QTreeView::rowsInserted(parent, start, end); - if(model()->rowCount(parent) == 1 && parent.data(NetworkModel::ItemTypeRole) == NetworkModel::NetworkItemType && parent.data(NetworkModel::ItemActiveRole) == true) { + if(model()->rowCount(parent) == 1 && parent.data(NetworkModel::ItemTypeRole) == NetworkModel::NetworkItemType + && (Global::SPUTDEV || parent.data(NetworkModel::ItemActiveRole) == true)) { // without updating the parent the expand will have no effect... Qt Bug? - update(parent); + update(parent); expand(parent); } } @@ -136,12 +139,16 @@ void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bott continue; bool isActive = networkIdx.data(NetworkModel::ItemActiveRole).toBool(); - if(isExpanded(networkIdx) != isActive) - setExpanded(networkIdx, isActive); + if(Global::SPUTDEV) { + if(isExpanded(networkIdx) != isActive) setExpanded(networkIdx, true); + } else { + if(isExpanded(networkIdx) != isActive) + setExpanded(networkIdx, isActive); + } } } - + void BufferView::toggleHeader(bool checked) { QAction *action = qobject_cast(sender()); header()->setSectionHidden((action->property("column")).toInt(), !checked); @@ -287,6 +294,8 @@ void BufferView::wheelEvent(QWheelEvent* event) { QSize BufferView::sizeHint() const { + return QSize(120, 50); + if(!model()) return QTreeView::sizeHint();