kget
bt::PeerSourceManager Class Reference
#include <peersourcemanager.h>

Detailed Description
This class manages all PeerSources.
Definition at line 51 of file peersourcemanager.h.
Signals | |
| void | statusChanged (const QString &ns) |
Public Member Functions | |
| void | addDHT () |
| void | addPeerSource (PeerSource *ps) |
| virtual void | addTracker (const KUrl &url, bool custom=true, int tier=1) |
| void | completed () |
| bool | dhtStarted () |
| Uint32 | getNumFailures () const |
| Uint32 | getNumLeechers () const |
| Uint32 | getNumSeeders () const |
| Uint32 | getTimeToNextUpdate () const |
| Uint32 | getTotalTimesDownloaded () const |
| virtual KUrl | getTrackerURL () const |
| virtual KUrl::List | getTrackerURLs () |
| bool | isStarted () const |
| virtual bool | isTrackerEnabled (const KUrl &url) const |
| void | manualUpdate () |
| PeerSourceManager (TorrentControl *tor, PeerManager *pman) | |
| void | removeDHT () |
| void | removePeerSource (PeerSource *ps) |
| virtual bool | removeTracker (const KUrl &url) |
| virtual void | restoreDefault () |
| void | scrape () |
| virtual void | setTracker (const KUrl &url) |
| virtual void | setTrackerEnabled (const KUrl &url, bool enabled) |
| void | start () |
| void | stop (WaitJob *wjob=0) |
| virtual | ~PeerSourceManager () |
Constructor & Destructor Documentation
| bt::PeerSourceManager::PeerSourceManager | ( | TorrentControl * | tor, | |
| PeerManager * | pman | |||
| ) |
Definition at line 43 of file peersourcemanager.cpp.
| bt::PeerSourceManager::~PeerSourceManager | ( | ) | [virtual] |
Definition at line 77 of file peersourcemanager.cpp.
Member Function Documentation
| void bt::PeerSourceManager::addDHT | ( | ) |
| void bt::PeerSourceManager::addPeerSource | ( | PeerSource * | ps | ) |
Add a PeerSource, the difference between PeerSource and Tracker is that only one Tracker can be used at the same time, PeerSource can always be used.
- Parameters:
-
ps The PeerSource
Definition at line 101 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::addTracker | ( | const KUrl & | url, | |
| bool | custom = true, |
|||
| int | tier = 1 | |||
| ) | [virtual] |
Adds a tracker URL to the list.
- Parameters:
-
url The URL custom Is it a custom tracker tier Which tier (or priority) the tracker has, tier 1 are the main trackers, tier 2 are backups ...
Implements bt::TrackersList.
Definition at line 226 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::completed | ( | ) |
Notify peersources and trackrs that the download is complete.
Definition at line 165 of file peersourcemanager.cpp.
| bool bt::PeerSourceManager::dhtStarted | ( | ) |
| Uint32 bt::PeerSourceManager::getNumFailures | ( | ) | const [inline] |
| Uint32 bt::PeerSourceManager::getNumLeechers | ( | ) | const |
| Uint32 bt::PeerSourceManager::getNumSeeders | ( | ) | const |
| Uint32 bt::PeerSourceManager::getTimeToNextUpdate | ( | ) | const |
Get the time to the next tracker update.
- Returns:
- The time in seconds
Definition at line 597 of file peersourcemanager.cpp.
| Uint32 bt::PeerSourceManager::getTotalTimesDownloaded | ( | ) | const |
Get the total time the torrent was downloaded according to the tracker.
Definition at line 616 of file peersourcemanager.cpp.
| KUrl bt::PeerSourceManager::getTrackerURL | ( | ) | const [virtual] |
Get the current tracker URL.
Implements bt::TrackersList.
Definition at line 202 of file peersourcemanager.cpp.
| KUrl::List bt::PeerSourceManager::getTrackerURLs | ( | ) | [virtual] |
Gets a list of available trackers.
Implements bt::TrackersList.
Definition at line 210 of file peersourcemanager.cpp.
| bool bt::PeerSourceManager::isStarted | ( | ) | const [inline] |
| bool bt::PeerSourceManager::isTrackerEnabled | ( | const KUrl & | url | ) | const [virtual] |
See if a tracker is enabled.
- Parameters:
-
url The tracker url
- Returns:
- true if it is, false if it isn't
Implements bt::TrackersList.
Definition at line 354 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::manualUpdate | ( | ) |
Do a manual update on all peer sources and trackers.
Definition at line 184 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::removeDHT | ( | ) |
Removes DHT from PeerSourceManager for this torrent.
Definition at line 635 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::removePeerSource | ( | PeerSource * | ps | ) |
Remove a Tracker or PeerSource.
- Parameters:
-
ps
Definition at line 108 of file peersourcemanager.cpp.
| bool bt::PeerSourceManager::removeTracker | ( | const KUrl & | url | ) | [virtual] |
Removes the tracker from the list.
- Parameters:
-
url - Tracker url.
Implements bt::TrackersList.
Definition at line 249 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::restoreDefault | ( | ) | [virtual] |
Restores the default tracker and does the announce.
Implements bt::TrackersList.
Definition at line 299 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::scrape | ( | ) |
| void bt::PeerSourceManager::setTracker | ( | const KUrl & | url | ) | [virtual] |
Sets the current tracker and does the announce.
- Parameters:
-
url - Tracker url.
Implements bt::TrackersList.
Definition at line 283 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::setTrackerEnabled | ( | const KUrl & | url, | |
| bool | enabled | |||
| ) | [virtual] |
Enable or disable a tracker.
- Parameters:
-
url The url enabled True to enable, false to disable
Implements bt::TrackersList.
Definition at line 336 of file peersourcemanager.cpp.
| void bt::PeerSourceManager::start | ( | ) |
| void bt::PeerSourceManager::statusChanged | ( | const QString & | ns | ) | [signal] |
Status has changed of the tracker.
- Parameters:
-
ns The new status
| void bt::PeerSourceManager::stop | ( | WaitJob * | wjob = 0 |
) |
Stop gathering peers.
- Parameters:
-
wjob WaitJob to wait at exit for the completion of stopped events to the trackers
Definition at line 145 of file peersourcemanager.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference