X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferview.cpp;h=7bc359a880ccd9e299e0362beca8b59201807891;hp=b5f5a573365559011f5ae2d1e0b270a7919129dd;hb=9f33f6e471dedbefe7bbe336a40312894628afe1;hpb=9c7495aa055da5207af31272b478523f2ed2a809 diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index b5f5a573..7bc359a8 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -485,6 +485,26 @@ void BufferView::wheelEvent(QWheelEvent* event) { changeBuffer((Direction)rowDelta); } +void BufferView::hideCurrentBuffer() { + QModelIndex index = selectionModel()->currentIndex(); + if(index.data(NetworkModel::ItemTypeRole) != NetworkModel::BufferItemType) + return; + + BufferId bufferId = index.data(NetworkModel::BufferIdRole).value(); + + //The check above means we won't be looking at a network, which should always be the first row, so we can just go backwards. + changeBuffer(Backward); + + /*if(removedRows.contains(bufferId)) + continue; + + removedRows << bufferId;*/ + /*if(permanently) + config()->requestRemoveBufferPermanently(bufferId); + else*/ + config()->requestRemoveBuffer(bufferId); +} + QSize BufferView::sizeHint() const { return QTreeView::sizeHint();