Revert "transmission: update from 2.13 to 2.22"
[tomato.git] / release / src / router / transmission / qt / tracker-model.h
blob191862466fe4427ad8568abf8aa5a74ff54cd6f5
1 /*
2 * This file Copyright (C) Mnemosyne LLC
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.
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10 * $Id: tracker-model.h 11092 2010-08-01 20:36:13Z charles $
13 #ifndef QTR_TRACKER_MODEL_H
14 #define QTR_TRACKER_MODEL_H
16 #include <QAbstractListModel>
17 #include <QSet>
18 #include <QVector>
20 #include "torrent.h"
21 #include "torrent-model.h"
23 struct TrackerInfo
25 TrackerStat st;
26 int torrentId;
28 Q_DECLARE_METATYPE(TrackerInfo)
30 class TrackerModel: public QAbstractListModel
32 Q_OBJECT
34 typedef QVector<TrackerInfo> rows_t;
35 rows_t myRows;
37 public:
38 void refresh( const TorrentModel&, const QSet<int>& ids );
39 int find( int torrentId, const QString& url ) const;
41 public:
42 virtual int rowCount( const QModelIndex& parent = QModelIndex() ) const;
43 virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
44 enum Role { TrackerRole = Qt::UserRole };
46 public:
47 TrackerModel( ) { }
48 virtual ~TrackerModel( ) { }
51 #endif