• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kget

bt::PeerSourceManager

bt::PeerSourceManager Class Reference

#include <peersourcemanager.h>

Inheritance diagram for bt::PeerSourceManager:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Joris Guisson <joris.guisson@gmail.com>

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 (  ) 

Adds DHT as PeerSource for this torrent.

Definition at line 621 of file peersourcemanager.cpp.

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 (  ) 

Checks if DHT is enabled.

Definition at line 648 of file peersourcemanager.cpp.

Uint32 bt::PeerSourceManager::getNumFailures (  )  const [inline]

Get the number of failures.

Definition at line 143 of file peersourcemanager.h.

Uint32 bt::PeerSourceManager::getNumLeechers (  )  const

Get the number of potential leechers.

Definition at line 611 of file peersourcemanager.cpp.

Uint32 bt::PeerSourceManager::getNumSeeders (  )  const

Get the number of potential seeders.

Definition at line 605 of file peersourcemanager.cpp.

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]

See if the PeerSourceManager has been started.

Definition at line 84 of file peersourcemanager.h.

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 (  ) 

Do a scrape on the current tracker.

Definition at line 178 of file peersourcemanager.cpp.

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 (  ) 

Start gathering peers.

Definition at line 115 of file peersourcemanager.cpp.

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:
  • peersourcemanager.h
  • peersourcemanager.cpp

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal