diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-05-25 18:11:38 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-05-25 18:11:38 +0000 |
| commit | 514be73c968985afd7fc73f264f44ccfa4bb0864 (patch) | |
| tree | 0749ac7aac9b79e1945e72cd85ad9a479391bfc0 /src/plugins/General/streambrowser/streamwindow.h | |
| parent | 77605cc89ecfe2fa74ae6c599f9cd7db4df84fec (diff) | |
| download | qmmp-514be73c968985afd7fc73f264f44ccfa4bb0864.tar.gz qmmp-514be73c968985afd7fc73f264f44ccfa4bb0864.tar.bz2 qmmp-514be73c968985afd7fc73f264f44ccfa4bb0864.zip | |
fixed streams sorting
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2725 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/streambrowser/streamwindow.h')
| -rw-r--r-- | src/plugins/General/streambrowser/streamwindow.h | 23 |
1 files changed, 23 insertions, 0 deletions
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 <QWidget> +#include <QSortFilterProxyModel> #include "ui_streamwindow.h" class QNetworkAccessManager; @@ -28,6 +29,7 @@ class QNetworkReply; class QStandardItemModel; class QSortFilterProxyModel; class QMenu; +class StreamsProxyModel; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -64,4 +66,25 @@ private: QMenu *m_favoritesMenu; }; +/** + @author Ilya Kotov <forkotov02@hotmail.ru> +*/ +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 |
