Last change
on this file since 11092 was
11092,
checked in by charles, 12 years ago
|
(trunk qt) synchronize the copyright notices
|
-
Property svn:keywords set to
Date Rev Author Id
|
File size:
1.3 KB
|
Line | |
---|
1 | /* |
---|
2 | * This file Copyright (C) Mnemosyne LLC |
---|
3 | * |
---|
4 | * This program is free software; you can redistribute it and/or modify |
---|
5 | * it under the terms of the GNU General Public License version 2 |
---|
6 | * as published by the Free Software Foundation. |
---|
7 | * |
---|
8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
9 | * |
---|
10 | * $Id: torrent-filter.h 11092 2010-08-01 20:36:13Z charles $ |
---|
11 | */ |
---|
12 | |
---|
13 | #ifndef QTR_TORRENT_FILTER_H |
---|
14 | #define QTR_TORRENT_FILTER_H |
---|
15 | |
---|
16 | #include <QSortFilterProxyModel> |
---|
17 | #include <QMetaType> |
---|
18 | #include <QVariant> |
---|
19 | |
---|
20 | class QString; |
---|
21 | class QWidget; |
---|
22 | |
---|
23 | class FilterMode; |
---|
24 | class Prefs; |
---|
25 | class Torrent; |
---|
26 | |
---|
27 | class TorrentFilter: public QSortFilterProxyModel |
---|
28 | { |
---|
29 | Q_OBJECT |
---|
30 | |
---|
31 | public: |
---|
32 | TorrentFilter( Prefs& prefs ); |
---|
33 | virtual ~TorrentFilter( ); |
---|
34 | |
---|
35 | public: |
---|
36 | enum TextMode { FILTER_BY_NAME, FILTER_BY_FILES, FILTER_BY_TRACKER }; |
---|
37 | int hiddenRowCount( ) const; |
---|
38 | |
---|
39 | private slots: |
---|
40 | void refreshPref( int key ); |
---|
41 | |
---|
42 | protected: |
---|
43 | virtual bool filterAcceptsRow( int, const QModelIndex& ) const; |
---|
44 | virtual bool lessThan( const QModelIndex&, const QModelIndex& ) const; |
---|
45 | |
---|
46 | private: |
---|
47 | bool activityFilterAcceptsTorrent( const Torrent * tor, const FilterMode& mode ) const; |
---|
48 | bool trackerFilterAcceptsTorrent( const Torrent * tor, const QString& tracker ) const; |
---|
49 | |
---|
50 | public: |
---|
51 | int count( const FilterMode& ) const; |
---|
52 | |
---|
53 | private: |
---|
54 | Prefs& myPrefs; |
---|
55 | }; |
---|
56 | |
---|
57 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.