X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferhotlistfilter.cpp;h=0df4203374b1cd44ffb5dabcd913329c459be9ac;hp=42dc813f2cced9cf6d14afcbc2f99001bfdd3d0b;hb=695758015a80eb8c158a9ac4c0f1c0b547e70df3;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222 diff --git a/src/uisupport/bufferhotlistfilter.cpp b/src/uisupport/bufferhotlistfilter.cpp index 42dc813f..0df42033 100644 --- a/src/uisupport/bufferhotlistfilter.cpp +++ b/src/uisupport/bufferhotlistfilter.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 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 {