X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferhotlistfilter.cpp;fp=src%2Fuisupport%2Fbufferhotlistfilter.cpp;h=e40f900080723dbf8bd6e2cf25e64c8616a7ce50;hp=b8ee379c729bf5b6823bffa72941c5d885e89987;hb=5a97f56014516db86ec784a964282d7678fec569;hpb=588c5e4a035f11bcb934d64813603ffdc8d270ed diff --git a/src/uisupport/bufferhotlistfilter.cpp b/src/uisupport/bufferhotlistfilter.cpp index b8ee379c..e40f9000 100644 --- a/src/uisupport/bufferhotlistfilter.cpp +++ b/src/uisupport/bufferhotlistfilter.cpp @@ -22,6 +22,7 @@ #include "networkmodel.h" + BufferHotListFilter::BufferHotListFilter(QAbstractItemModel *source, QObject *parent) : QSortFilterProxyModel(parent) { @@ -30,6 +31,13 @@ BufferHotListFilter::BufferHotListFilter(QAbstractItemModel *source, QObject *pa sort(0, Qt::DescendingOrder); // enable sorting... this is "usually" triggered by a enabling setSortingEnabled(true) on a view; } +BufferId BufferHotListFilter::hottestBuffer() +{ + invalidate(); + sort(0, Qt::DescendingOrder); + QModelIndex topIndex = index(0,0); + return data(topIndex, NetworkModel::BufferIdRole).value(); +} bool BufferHotListFilter::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {