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>
21 #include "torrent-model.h"
28 Q_DECLARE_METATYPE(TrackerInfo
)
30 class TrackerModel
: public QAbstractListModel
34 typedef QVector
<TrackerInfo
> rows_t
;
38 void refresh( const TorrentModel
&, const QSet
<int>& ids
);
39 int find( int torrentId
, const QString
& url
) const;
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
};
48 virtual ~TrackerModel( ) { }