35
36
class BTCORE_EXPORT TrackersList
39
virtual ~TrackersList();
42
* Get the current tracker URL.
44
virtual KUrl getTrackerURL() const = 0;
47
* Gets a list of available trackers.
49
virtual KUrl::List getTrackerURLs() = 0;
52
* Adds a tracker URL to the list.
54
* @param custom Is it a custom tracker
55
* @param tier Which tier (or priority) the tracker has, tier 1 are
56
* the main trackers, tier 2 are backups ...
58
virtual void addTracker(const KUrl &url, bool custom = true,int tier = 1) = 0;
61
* Removes the tracker from the list.
62
* @param url - Tracker url.
64
virtual bool removeTracker(const KUrl &url) = 0;
67
* Sets the current tracker and does the announce.
68
* @param url - Tracker url.
70
virtual void setTracker(const KUrl &url) = 0;
73
* Restores the default tracker and does the announce.
75
virtual void restoreDefault() = 0;
78
* Enable or disable a tracker
80
* @param enabled True to enable, false to disable
82
virtual void setTrackerEnabled(const KUrl & url,bool enabled) = 0;
85
* See if a tracker is enabled
86
* @param url The tracker url
87
* @return true if it is, false if it isn't
89
virtual bool isTrackerEnabled(const KUrl & url) const = 0;
92
* Merge an other tracker list.
93
* @param first The first TrackerTier
95
void merge(const bt::TrackerTier* first);
40
virtual ~TrackersList();
43
* Get the current tracker (for non private torrents this returns 0, seeing that
44
* all trackers are used at the same time)
46
virtual TrackerInterface* getCurrentTracker() const = 0;
49
* Sets the current tracker and does the announce. For non private torrents, this
51
* @param t The Tracker
53
virtual void setCurrentTracker(TrackerInterface* t) = 0;
56
* Sets the current tracker and does the announce. For non private torrents, this
58
* @param url Url of the tracker
60
virtual void setCurrentTracker(const KUrl & url) = 0;
63
* Gets a list of all available trackers.
65
virtual QList<TrackerInterface*> getTrackers() = 0;
68
* Adds a tracker URL to the list.
70
* @param custom Is it a custom tracker
71
* @param tier Which tier (or priority) the tracker has, tier 1 are
72
* the main trackers, tier 2 are backups ...
75
virtual TrackerInterface* addTracker(const KUrl &url, bool custom = true,int tier = 1) = 0;
78
* Removes the tracker from the list.
79
* @param t The Tracker
81
virtual bool removeTracker(TrackerInterface* t) = 0;
84
* Removes the tracker from the list.
85
* @param url The tracker url
87
virtual bool removeTracker(const KUrl & url) = 0;
90
* Return true if a tracker can be removed
91
* @param t The tracker
93
virtual bool canRemoveTracker(TrackerInterface* t) = 0;
96
* Restores the default tracker and does the announce.
98
virtual void restoreDefault() = 0;
101
* Set a tracker enabled or not
103
virtual void setTrackerEnabled(const KUrl & url,bool on) = 0;
106
* Merge an other tracker list.
107
* @param first The first TrackerTier
109
void merge(const bt::TrackerTier* first);