@ -51,8 +51,6 @@
# include "qtorrenthandle.h"
# include "qtorrenthandle.h"
# include "trackerinfos.h"
# include "trackerinfos.h"
using namespace libtorrent ;
# define MAX_SAMPLES 20
# define MAX_SAMPLES 20
class downloadThread ;
class downloadThread ;
@ -75,11 +73,11 @@ public:
static void drop ( ) ;
static void drop ( ) ;
~ QBtSession ( ) ;
~ QBtSession ( ) ;
QTorrentHandle getTorrentHandle ( QString hash ) const ;
QTorrentHandle getTorrentHandle ( QString hash ) const ;
std : : vector < torrent_handle > getTorrents ( ) const ;
std : : vector < libtorrent : : torrent_handle > getTorrents ( ) const ;
bool isFilePreviewPossible ( QString fileHash ) const ;
bool isFilePreviewPossible ( QString fileHash ) const ;
float getPayloadDownloadRate ( ) const ;
float getPayloadDownloadRate ( ) const ;
float getPayloadUploadRate ( ) const ;
float getPayloadUploadRate ( ) const ;
session_status getSessionStatus ( ) const ;
libtorrent : : session_status getSessionStatus ( ) const ;
int getListenPort ( ) const ;
int getListenPort ( ) const ;
float getRealRatio ( QString hash ) const ;
float getRealRatio ( QString hash ) const ;
QHash < QString , TrackerInfos > getTrackersInfo ( QString hash ) const ;
QHash < QString , TrackerInfos > getTrackersInfo ( QString hash ) const ;
@ -91,7 +89,7 @@ public:
qlonglong getETA ( QString hash ) ;
qlonglong getETA ( QString hash ) ;
inline QStringList getConsoleMessages ( ) const { return consoleMessages ; }
inline QStringList getConsoleMessages ( ) const { return consoleMessages ; }
inline QStringList getPeerBanMessages ( ) const { return peerBanMessages ; }
inline QStringList getPeerBanMessages ( ) const { return peerBanMessages ; }
inline session * getSession ( ) const { return s ; }
inline libtorrent : : session * getSession ( ) const { return s ; }
inline bool useTemporaryFolder ( ) const { return ! defaultTempPath . isEmpty ( ) ; }
inline bool useTemporaryFolder ( ) const { return ! defaultTempPath . isEmpty ( ) ; }
inline QString getDefaultSavePath ( ) const { return defaultSavePath ; }
inline QString getDefaultSavePath ( ) const { return defaultSavePath ; }
inline ScanFoldersModel * getScanFoldersModel ( ) const { return m_scanFolders ; }
inline ScanFoldersModel * getScanFoldersModel ( ) const { return m_scanFolders ; }
@ -132,8 +130,8 @@ public slots:
void setUploadRateLimit ( long rate ) ;
void setUploadRateLimit ( long rate ) ;
void setMaxRatio ( float ratio ) ;
void setMaxRatio ( float ratio ) ;
void setDHTPort ( int dht_port ) ;
void setDHTPort ( int dht_port ) ;
void setProxySettings ( const proxy_settings & proxySettings ) ;
void setProxySettings ( const libtorrent : : proxy_settings & proxySettings ) ;
void setSessionSettings ( const session_settings & sessionSettings ) ;
void setSessionSettings ( const libtorrent : : session_settings & sessionSettings ) ;
void startTorrentsInPause ( bool b ) ;
void startTorrentsInPause ( bool b ) ;
void setDefaultTempPath ( QString temppath ) ;
void setDefaultTempPath ( QString temppath ) ;
void setAppendLabelToSavePath ( bool append ) ;
void setAppendLabelToSavePath ( bool append ) ;
@ -143,7 +141,7 @@ public slots:
void appendqBextensionToTorrent ( QTorrentHandle & h , bool append ) ;
void appendqBextensionToTorrent ( QTorrentHandle & h , bool append ) ;
void setAppendqBExtension ( bool append ) ;
void setAppendqBExtension ( bool append ) ;
# endif
# endif
void applyEncryptionSettings ( pe_settings se ) ;
void applyEncryptionSettings ( libtorrent : : pe_settings se ) ;
void setDownloadLimit ( QString hash , long val ) ;
void setDownloadLimit ( QString hash , long val ) ;
void setUploadLimit ( QString hash , long val ) ;
void setUploadLimit ( QString hash , long val ) ;
void enableUPnP ( bool b ) ;
void enableUPnP ( bool b ) ;
@ -169,7 +167,7 @@ protected:
bool loadFastResumeData ( QString hash , std : : vector < char > & buf ) ;
bool loadFastResumeData ( QString hash , std : : vector < char > & buf ) ;
void loadTorrentSettings ( QTorrentHandle h ) ;
void loadTorrentSettings ( QTorrentHandle h ) ;
void loadTorrentTempData ( QTorrentHandle h , QString savePath , bool magnet ) ;
void loadTorrentTempData ( QTorrentHandle h , QString savePath , bool magnet ) ;
add_torrent_params initializeAddTorrentParams ( QString hash ) ;
libtorrent : : add_torrent_params initializeAddTorrentParams ( QString hash ) ;
protected slots :
protected slots :
void addTorrentsFromScanFolder ( QStringList & ) ;
void addTorrentsFromScanFolder ( QStringList & ) ;
@ -181,7 +179,7 @@ protected slots:
void sendNotificationEmail ( QTorrentHandle h ) ;
void sendNotificationEmail ( QTorrentHandle h ) ;
void autoRunExternalProgram ( QTorrentHandle h , bool async = true ) ;
void autoRunExternalProgram ( QTorrentHandle h , bool async = true ) ;
void cleanUpAutoRunProcess ( int ) ;
void cleanUpAutoRunProcess ( int ) ;
void mergeTorrents ( QTorrentHandle h_ex , boost : : intrusive_ptr < torrent_info > t ) ;
void mergeTorrents ( QTorrentHandle h_ex , boost : : intrusive_ptr < libtorrent : : torrent_info > t ) ;
void exportTorrentFile ( QTorrentHandle h ) ;
void exportTorrentFile ( QTorrentHandle h ) ;
signals :
signals :
@ -211,7 +209,7 @@ private:
private :
private :
// Bittorrent
// Bittorrent
session * s ;
libtorrent : : session * s ;
QPointer < QTimer > timerAlerts ;
QPointer < QTimer > timerAlerts ;
QPointer < BandwidthScheduler > bd_scheduler ;
QPointer < BandwidthScheduler > bd_scheduler ;
QMap < QUrl , QPair < QString , QString > > savepathLabel_fromurl ;
QMap < QUrl , QPair < QString , QString > > savepathLabel_fromurl ;