X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferhotlistfilter.cpp;h=0df4203374b1cd44ffb5dabcd913329c459be9ac;hp=da68ebac69f38675b4ffa126c033f82e3b7f93cc;hb=695758015a80eb8c158a9ac4c0f1c0b547e70df3;hpb=04315f46a16fc3627218377071e008b6b9744992 diff --git a/src/uisupport/bufferhotlistfilter.cpp b/src/uisupport/bufferhotlistfilter.cpp index da68ebac..0df42033 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-2015 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 {