Add option to set stream as favourite
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "streamsproxymodel.h"
|
||||
#include "streamsmodel.h"
|
||||
|
||||
StreamsProxyModel::StreamsProxyModel(QObject *parent) : QSortFilterProxyModel(parent)
|
||||
{
|
||||
@@ -30,3 +31,12 @@ StreamsProxyModel::StreamsProxyModel(QObject *parent) : QSortFilterProxyModel(pa
|
||||
setSortLocaleAware(true);
|
||||
sort(0);
|
||||
}
|
||||
|
||||
bool StreamsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
{
|
||||
StreamsModel::Stream *l=static_cast<StreamsModel::Stream *>(left.internalPointer());
|
||||
StreamsModel::Stream *r=static_cast<StreamsModel::Stream *>(right.internalPointer());
|
||||
|
||||
return l->favorite > r->favorite
|
||||
|| (l->favorite==r->favorite && l->name.localeAwareCompare(r->name)<0);
|
||||
}
|
||||
Reference in New Issue
Block a user