mirror of
https://github.com/transmission/transmission
synced 2024-12-27 01:57:52 +00:00
4b9626bb83
1. add the option the code to be used under GPLv2 or GPLv3; previously only GPLv2 was allowed 2. add the "proxy option" as described in GPLv3 so we can add future licenses without having to bulk-edit everything again :) 3. remove the awkward "exception for MIT code in Mac client" clause; it was unnecessary and confusing.
48 lines
1,008 B
C++
48 lines
1,008 B
C++
/*
|
|
* This file Copyright (C) 2010-2014 Mnemosyne LLC
|
|
*
|
|
* It may be used under the GNU Public License v2 or v3 licenses,
|
|
* or any future license endorsed by Mnemosyne LLC.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#ifndef QTR_TRACKER_MODEL_H
|
|
#define QTR_TRACKER_MODEL_H
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QSet>
|
|
#include <QVector>
|
|
|
|
#include "torrent.h"
|
|
#include "torrent-model.h"
|
|
|
|
struct TrackerInfo
|
|
{
|
|
TrackerStat st;
|
|
int torrentId;
|
|
};
|
|
Q_DECLARE_METATYPE(TrackerInfo)
|
|
|
|
class TrackerModel: public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
typedef QVector<TrackerInfo> rows_t;
|
|
rows_t myRows;
|
|
|
|
public:
|
|
void refresh (const TorrentModel&, const QSet<int>& ids);
|
|
int find (int torrentId, const QString& url) const;
|
|
|
|
public:
|
|
virtual int rowCount (const QModelIndex& parent = QModelIndex()) const;
|
|
virtual QVariant data (const QModelIndex& index, int role = Qt::DisplayRole) const;
|
|
enum Role { TrackerRole = Qt::UserRole };
|
|
|
|
public:
|
|
TrackerModel () {}
|
|
virtual ~TrackerModel () {}
|
|
};
|
|
|
|
#endif
|