- Added download from url handling in GUI (still missing: search plugin update and rss)

This commit is contained in:
Christophe Dumez 2007-07-20 20:18:18 +00:00
parent 2fd0de082c
commit 1fb848e9ed
6 changed files with 44 additions and 8 deletions

View file

@ -51,6 +51,7 @@ bittorrent::bittorrent(){
// To download from urls
downloader = new downloadThread(this);
connect(downloader, SIGNAL(downloadFinished(const QString&, const QString&)), this, SLOT(processDownloadedFile(const QString&, const QString&)));
connect(downloader, SIGNAL(downloadFailure(const QString&, const QString&)), this, SLOT(HandleDownloadFailure(const QString&, const QString&)));
}
// Main destructor
@ -78,6 +79,10 @@ void bittorrent::setUploadLimit(QString hash, int val){
saveTorrentSpeedLimits(hash);
}
void bittorrent::HandleDownloadFailure(const QString& url, const QString& reason){
emit downloadFromUrlFailure(url, reason);
}
void bittorrent::updateETAs(){
std::vector<torrent_handle> handles = s->get_torrents();
for(unsigned int i=0; i<handles.size(); ++i){
@ -1014,12 +1019,6 @@ void bittorrent::downloadFromUrl(const QString& url){
// Add to bittorrent session the downloaded torrent file
void bittorrent::processDownloadedFile(const QString& url, const QString& file_path){
// if(return_code){
// // Download failed
// emit downloadFromUrlFailure(url, errorBuffer);
// QFile::remove(file_path);
// return;
// }
// Add file to torrent download list
emit newDownloadedTorrent(file_path, url);
}