X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferhotlistfilter.cpp;h=9fafab1773574a976f99d98d54e9c7ab882022b0;hp=da68ebac69f38675b4ffa126c033f82e3b7f93cc;hb=00e1a9c29e792ba4d65dba21b7ba04131bcb13bc;hpb=4a5065255e652dd0c301bac0db41b7afb777ef49 diff --git a/src/uisupport/bufferhotlistfilter.cpp b/src/uisupport/bufferhotlistfilter.cpp index da68ebac..9fafab17 100644 --- a/src/uisupport/bufferhotlistfilter.cpp +++ b/src/uisupport/bufferhotlistfilter.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -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 {