mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Improved a lot downloading from url using libcommoncpp2 instead of libcurl
- TODO soon: - Updated configure file - Add url download error handling
This commit is contained in:
parent
347b03d699
commit
7c8677d787
7 changed files with 61 additions and 93 deletions
|
@ -50,7 +50,7 @@ bittorrent::bittorrent(){
|
|||
ETARefresher.start(6000);
|
||||
// To download from urls
|
||||
downloader = new downloadThread(this);
|
||||
connect(downloader, SIGNAL(downloadFinished(const QString&, const QString&, int, const QString&)), this, SLOT(processDownloadedFile(const QString&, const QString&, int, const QString&)));
|
||||
connect(downloader, SIGNAL(downloadFinished(const QString&, const QString&)), this, SLOT(processDownloadedFile(const QString&, const QString&)));
|
||||
}
|
||||
|
||||
// Main destructor
|
||||
|
@ -1013,13 +1013,13 @@ void bittorrent::downloadFromUrl(const QString& url){
|
|||
}
|
||||
|
||||
// Add to bittorrent session the downloaded torrent file
|
||||
void bittorrent::processDownloadedFile(const QString& url, const QString& file_path, int return_code, const QString& errorBuffer){
|
||||
if(return_code){
|
||||
// Download failed
|
||||
emit downloadFromUrlFailure(url, errorBuffer);
|
||||
QFile::remove(file_path);
|
||||
return;
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue