From 514be73c968985afd7fc73f264f44ccfa4bb0864 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 25 May 2012 18:11:38 +0000 Subject: fixed streams sorting git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2725 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/streambrowser/streamwindow.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/plugins/General/streambrowser/streamwindow.h') diff --git a/src/plugins/General/streambrowser/streamwindow.h b/src/plugins/General/streambrowser/streamwindow.h index 35844702d..9e29e81e3 100644 --- a/src/plugins/General/streambrowser/streamwindow.h +++ b/src/plugins/General/streambrowser/streamwindow.h @@ -21,6 +21,7 @@ #define STREAMWINDOW_H #include +#include #include "ui_streamwindow.h" class QNetworkAccessManager; @@ -28,6 +29,7 @@ class QNetworkReply; class QStandardItemModel; class QSortFilterProxyModel; class QMenu; +class StreamsProxyModel; /** @author Ilya Kotov @@ -64,4 +66,25 @@ private: QMenu *m_favoritesMenu; }; +/** + @author Ilya Kotov +*/ +class StreamsProxyModel: public QSortFilterProxyModel +{ +Q_OBJECT +public: + StreamsProxyModel(QObject *parent) : QSortFilterProxyModel(parent){} + +protected: + bool lessThan (const QModelIndex &left, const QModelIndex &right) const + { + if(left.column() == 2 && right.column() == 2) + { + return sourceModel()->data(left).toInt() < sourceModel()->data(right).toInt(); + } + return QSortFilterProxyModel::lessThan(left, right); + } +}; + + #endif -- cgit v1.2.3-13-gbd6f