1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-11-02 08:10:54 +01:00

Compare commits

..

58 Commits

Author SHA1 Message Date
Christophe Dumez
9c0751ed4b - Tagged v1.5.0beta2 2009-08-23 14:59:51 +00:00
Christophe Dumez
fd81567ecd - Remembering open state of RSS folders on startup 2009-08-23 14:56:44 +00:00
Christophe Dumez
8e5f5b5d65 - Fixed crash on feed deletion 2009-08-23 13:52:45 +00:00
Christophe Dumez
215d561b82 - When adding a new feed, add it to the selected folder 2009-08-23 13:47:45 +00:00
Christophe Dumez
dc18780a97 - "Mark items read" on a folder now updates number of unread news 2009-08-23 13:39:15 +00:00
Christophe Dumez
06fb19e8be - Updated selectFirstFeed() function due to code rewrite 2009-08-23 13:35:45 +00:00
Christophe Dumez
3550e31871 - Remove useless code 2009-08-23 13:26:16 +00:00
Christophe Dumez
46c6c4fc9a - UpdateSelectedItems() now sets loading.png icon for all feeds included in selected folders 2009-08-23 13:20:26 +00:00
Christophe Dumez
e126de8ff5 - Always keep number of unread news per folders up to date
- RefreshAllFeeds() only sets loading.png icon for feeds (and not folders)
2009-08-23 13:05:47 +00:00
Christophe Dumez
f2d2e70967 - Updated number of unread news of RSS folders after a feed is moved from one folder to another 2009-08-23 12:49:37 +00:00
Christophe Dumez
48b14d1066 - Major rewrite of rss grouping code because I did not like my first approach. It is not complete yet but it is far more clean and stable 2009-08-23 12:22:19 +00:00
Christophe Dumez
725700420c - RSS feed parent was not updated after being moved to another folder 2009-08-23 09:10:45 +00:00
Christophe Dumez
480df1f5dc - Fixed crash when selecting feeds after they were moved 2009-08-23 09:05:36 +00:00
Christophe Dumez
2fa43dd973 - Started to implement drag n drop in feed list but it is still very buggy 2009-08-23 08:10:56 +00:00
Christophe Dumez
b9f1586068 - Expand parent folder when a new subfolder is created
- Fixed folder renaming
2009-08-22 15:33:31 +00:00
Christophe Dumez
07dbe388f4 - Started to implement 'new Folder' feature for RSS grouping
- Fixed a bug in 'Feed subscribe', the type of the new feed (STREAM) was not set
2009-08-22 15:26:39 +00:00
Christophe Dumez
b2af40c95b - Updated some icons to oxygen theme
- Prepared actions for rss grouping
2009-08-22 15:01:53 +00:00
Christophe Dumez
05569a5011 - Added some more function for rss feeds grouping 2009-08-22 14:41:58 +00:00
Christophe Dumez
73dbce45b2 - Most of the code is there for rss feeds grouping. However it is not used yet and it is probably quite unstable 2009-08-22 14:06:05 +00:00
Christophe Dumez
fdaeafc701 - Fixed overwriting confirmation -> should have 'Yes/No' buttons, not 'Ok' 2009-08-22 13:44:05 +00:00
Christophe Dumez
9ca4e2f1f6 - RSS code remodeling to improve robustness 2009-08-22 03:00:31 +00:00
Christophe Dumez
2b53aa7e81 - Use clickedItem event to update news read status instead of currentItem one to avoid marking items as read although they were not actually clicked by the user
- Use the actual number of unread news instead of (0) when adding a RSS stream to the list since it is now possible that unread news were loaded from hard disk by the class constructor
2009-08-22 02:43:11 +00:00
Christophe Dumez
8e79e918c5 - RSS toolbar: text besides icons instead of under to reduce bar height 2009-08-22 02:34:11 +00:00
Christophe Dumez
687842a949 Code cleanup 2009-08-22 02:30:28 +00:00
Christophe Dumez
645ee86860 Fixed new RSS tab layout (Toolbar) 2009-08-22 02:27:36 +00:00
Christophe Dumez
f50762dfa8 - Updated language files and icon resource file 2009-08-22 02:23:56 +00:00
Christophe Dumez
7e252d3fbd - COSMETIC: Redesigned RSS tab to improve usability 2009-08-22 02:19:40 +00:00
Christophe Dumez
2dc9f10bf4 - Fixed 'Mark all as read' would not refresh news list 2009-08-21 18:36:50 +00:00
Christophe Dumez
bca03706a0 - Delete code that is no longer used 2009-08-21 18:33:36 +00:00
Christophe Dumez
e7663e7b6b - Fixed a slight bug in default RSS feed downloader filter rule (use rule name instead as '*') 2009-08-21 18:27:45 +00:00
Christophe Dumez
2b0e05b453 - Some more RSS polishing 2009-08-21 18:24:29 +00:00
Christophe Dumez
4d67170d3e - Fixed tiny bug in RSS feeds refreshing code 2009-08-21 18:02:35 +00:00
Christophe Dumez
538c028f8a - Some more RSS polishing 2009-08-21 17:49:48 +00:00
Christophe Dumez
2cbbd6ef50 - Slightly improved RSS feeds loading: Saved news can be displayed before the Feed is effectively updated 2009-08-21 14:48:33 +00:00
Christophe Dumez
955d8069e2 - RSS fix: Make sure to update refreshed boolean only if the RSS feed have been refreshed 2009-08-21 14:15:23 +00:00
Christophe Dumez
25d998f1b5 - Added magnet URI support to Web UI 2009-08-21 14:05:03 +00:00
Christophe Dumez
462f6c41cd - Updated Changelog 2009-08-21 11:58:08 +00:00
Christophe Dumez
298f1e6a9a - FEATURE: If a torrent contains a torrent file, process downloaded torrent file too 2009-08-21 11:26:58 +00:00
Christophe Dumez
2926745102 - Added Import / Export feature for RSS feed downloader filters 2009-08-21 10:17:00 +00:00
Christophe Dumez
c6003c7403 - Reorganized RSS feeds popup menu 2009-08-21 09:06:57 +00:00
Christophe Dumez
66e5a6672a - It is now possible to rename Feed downloader filters 2009-08-21 09:01:18 +00:00
Christophe Dumez
c35500dd29 - Already present RSS news were not remembered on startup 2009-08-21 08:30:10 +00:00
Christophe Dumez
f80bd42361 - Fixed RSS feed filter matching (did not take 'not' tokens into consideration)
- Added a RSS feed filter tester for easy setup)
- Updated language files
2009-08-21 08:19:32 +00:00
Christophe Dumez
0b9c05d41b - FEATURE: Make use of torrent enclosure in RSS feeds for direct download
- FEATURE: Implemented a RSS feed downloader with filter support
- FEATURE: Save old RSS item to hard disk to remember them on start up
- FEATURE: RSS Feeds can now be copied to the clipboard
2009-08-21 07:40:57 +00:00
Christophe Dumez
2477dc1fc0 - FEATURE: In torrent addition from URL, paste clipboard content if it contains an URL 2009-08-18 03:29:34 +00:00
Christophe Dumez
706362333d - Attempt to support FreeDiskSpace() on Windows platform
* Totally untested, not even sure it compiles but if not it should be easy to fix
2009-08-17 14:53:41 +00:00
Christophe Dumez
6fcf25af52 - FEATURE: Display free disk space in torrent addition dialog
- Added some disambiguation for translators
2009-08-17 13:17:52 +00:00
Christophe Dumez
c8e8306e0a - Added "Copy magnet link" entry to right click menu now that we support magnet URIs 2009-08-17 10:22:41 +00:00
Christophe Dumez
e429126934 - Ok. torrentless downloads paused state is now restored properly (once metadata is received) 2009-08-17 08:08:51 +00:00
Christophe Dumez
7e71de558a - catching invalid_handle exception to avoid rare crashes 2009-08-17 06:01:35 +00:00
Christophe Dumez
09d8a4797d - Make sure torrent handle is valid before updating the torrent 2009-08-17 05:50:47 +00:00
Christophe Dumez
1bcb8b1ed8 - Disabled force recheck for torrents with no metadata 2009-08-17 05:35:20 +00:00
Christophe Dumez
d132d50f4d - Torrentless downloads are no longer added in pause (temporary workaround as I think it is better not to start in paused state). 2009-08-17 05:23:58 +00:00
Christophe Dumez
e619b6977a - Added Magnet URI support (might be still buggy)
* Known problem: Always added in paused state for some obscure reason)
2009-08-17 05:14:03 +00:00
Christophe Dumez
2742a54d6e - Rewrited torrent resume code to make it cleaner and more generic
* magnet URI support should be easy to implement now
Warning: Since a lot of code was rewrited, some bugs may have been introduced
2009-08-16 03:09:20 +00:00
Christophe Dumez
360a327d7d - Updated version to v1.5.0 (alpha) 2009-08-15 02:37:03 +00:00
Christophe Dumez
b659303419 - Bump to v1.5.0alpha 2009-08-14 15:57:08 +00:00
Christophe Dumez
43108712be - Removed rc2 from version 2009-08-13 03:54:35 +00:00
112 changed files with 20861 additions and 9481 deletions

View File

@@ -1,3 +1,23 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
- FEATURE: Added Magnet URI support
- FEATURE: Make use of torrent enclosure in RSS feeds for direct download
- FEATURE: Implemented a RSS feed downloader with filter support
- FEATURE: Save old RSS item to hard disk to remember them on start up
- FEATURE: Display free disk space in torrent addition dialog
- FEATURE: In torrent addition from URL, paste clipboard content if it contains an URL
- FEATURE: RSS feeds URLs can now be copied to clipboard
- FEATURE: RSS feeds can now be grouped into folders
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
- BUGFIX: torrent resume code rewrited
- COSMETIC: Redesigned RSS tab to improve usability
* Sun Aug 21 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.1
- BUGFIX: Fix problems when changing save path (if using temporary download folder)
- BUGFIX: Display real save path instead of the temporary one in torrent properties
- BUGFIX: Catching invalid_handle exception to avoid rare crashes
- BUGFIX: Fixed popup menu position in RSS feeds list
- BUGFIX: Don't save RSS feed state if it could not be updated
* Thu Aug 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.0
- FEATURE: Display swarm information in lists
- FEATURE: Allow to define temporary download folder

View File

@@ -23,7 +23,7 @@ public:
if(!libs.isEmpty())
conf->addLib(libs);
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
printf("\nWarning: libtorrent-rasterbar v%s was detected. Although it will compile and run, you will probably experience some bugs. Please consider updating to v%s!\n", version.toUtf8().data(), adv_ver.toUtf8().data());
printf("\nWarning: libtorrent-rasterbar v%s was detected. Although it will compile and run, you will probably experience some bugs. Please consider updating to v%s!\n", version.toLocal8Bit().data(), adv_ver.toUtf8().data());
return true;
}
};

480
src/FeedDownloader.h Normal file

File diff suppressed because it is too large Load Diff

546
src/FeedDownloader.ui Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -64,6 +64,8 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
if(!loadColWidthFinishedList()){
finishedList->header()->resizeSection(0, 200);
}
// Connect BTSession signals
connect(BTSession, SIGNAL(metadataReceived(QTorrentHandle&)), this, SLOT(updateMetadata(QTorrentHandle&)));
// Make download list header clickable for sorting
finishedList->header()->setClickable(true);
finishedList->header()->setSortIndicatorShown(true);
@@ -79,6 +81,8 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
actionCopy_magnet_link->setIcon(QIcon(QString::fromUtf8(":/Icons/magnet.png")));
connect(actionPause, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPause_triggered()));
connect(actionStart, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionStart_triggered()));
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_triggered()));
@@ -88,6 +92,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
connect(actionBuy_it, SIGNAL(triggered()), (GUI*)parent, SLOT(goBuyPage()));
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
connect(actionForce_recheck, SIGNAL(triggered()), this, SLOT(forceRecheck()));
connect(actionCopy_magnet_link, SIGNAL(triggered()), (GUI*)parent, SLOT(copyMagnetURI()));
connect(actionHOSColName, SIGNAL(triggered()), this, SLOT(hideOrShowColumnName()));
connect(actionHOSColSize, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSize()));
@@ -266,7 +271,18 @@ void FinishedTorrents::on_actionSet_upload_limit_triggered(){
new BandwidthAllocationDialog(this, true, BTSession, hashes);
}
void FinishedTorrents::updateMetadata(QTorrentHandle &h) {
QString hash = h.hash();
int row = getRowFromHash(hash);
if(row != -1) {
qDebug("Updating torrent metadata in download list");
finishedListModel->setData(finishedListModel->index(row, F_NAME), QVariant(h.name()));
finishedListModel->setData(finishedListModel->index(row, F_SIZE), QVariant((qlonglong)h.actual_size()));
}
}
void FinishedTorrents::updateTorrent(QTorrentHandle h) {
if(!h.is_valid()) return;
QString hash = h.hash();
int row = getRowFromHash(hash);
if(row == -1){
@@ -433,6 +449,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint&){
myFinishedListMenu.addAction(actionOpen_destination_folder);
myFinishedListMenu.addAction(actionTorrent_Properties);
myFinishedListMenu.addSeparator();
myFinishedListMenu.addAction(actionCopy_magnet_link);
myFinishedListMenu.addAction(actionBuy_it);
// Call menu

View File

@@ -93,6 +93,7 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
void deleteTorrent(QString hash);
void showPropertiesFromHash(QString hash);
void loadLastSortedColumn();
void updateMetadata(QTorrentHandle &h);
signals:
void torrentMovedFromFinishedList(QString);

File diff suppressed because it is too large Load Diff

View File

@@ -143,6 +143,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
void fullDiskError(QTorrentHandle& h, QString msg) const;
void handleDownloadFromUrlFailure(QString, QString) const;
void createSystrayDelayed();
void setPaused(QTorrentHandle &h) const;
// Keyboard shortcuts
void createKeyboardShortcuts();
void displayDownTab() const;
@@ -191,6 +192,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
void setTabText(int index, QString text) const;
void openDestinationFolder() const;
void goBuyPage() const;
void copyMagnetURI() const;
void updateRatio();
protected:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
src/Icons/magnet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Categories=Qt;Network;P2P
Comment=V1.4.0
Comment=V1.5.0
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[bg]=Торент клиент

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 722 B

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@
#include "misc.h"
class torrent_file {
private:
private:
torrent_file *parent;
bool is_dir;
QString rel_path;
@@ -47,7 +47,7 @@ class torrent_file {
int priority;
int index; // Index in torrent_info
public:
public:
torrent_file(torrent_file *parent, QString path, bool dir, size_type size=0, int index=-1, float progress=0., int priority=1): parent(parent), is_dir(dir), size(size), progress(progress), priority(priority), index(index){
qDebug("created a file with index %d", index);
rel_path = QDir::cleanPath(path);
@@ -175,10 +175,10 @@ class torrent_file {
};
class arborescence {
private:
private:
torrent_file *root;
public:
public:
arborescence(boost::intrusive_ptr<torrent_info> t) {
torrent_info::file_iterator fi = t->begin_files();
if(t->num_files() > 1) {
@@ -199,7 +199,7 @@ class arborescence {
Q_ASSERT(root->getSize() == t->total_size());
}
arborescence(torrent_info const& t, std::vector<size_type> fp, int *prioritiesTab) {
arborescence(torrent_info const& t, std::vector<size_type> fp, std::vector<int> files_priority) {
torrent_info::file_iterator fi = t.begin_files();
if(t.num_files() > 1) {
qDebug("More than one file in the torrent, setting a folder as root");
@@ -207,13 +207,13 @@ class arborescence {
} else {
// XXX: Will crash if there is no file in torrent
qDebug("one file in the torrent, setting it as root with index 0");
root = new torrent_file(0, misc::toQString(t.name()), false, fi->size, 0, ((double)fp[0])/t.file_at(0).size, prioritiesTab[0]);
root = new torrent_file(0, misc::toQString(t.name()), false, fi->size, 0, ((double)fp[0])/t.file_at(0).size, files_priority.at(0));
return;
}
int i = 0;
while(fi != t.end_files()) {
QString path = QDir::cleanPath(misc::toQString(fi->path.string()));
addFile(path, fi->size, i, ((double)fp[i])/t.file_at(i).size, prioritiesTab[i]);
addFile(path, fi->size, i, ((double)fp[i])/t.file_at(i).size, files_priority.at(i));
fi++;
++i;
}
@@ -237,7 +237,7 @@ class arborescence {
return success;
}
protected:
protected:
void addFile(QString path, size_type file_size, int index, float progress=0., int priority=1) {
Q_ASSERT(root->isDir());
path = QDir::cleanPath(path);

File diff suppressed because it is too large Load Diff

View File

@@ -76,6 +76,7 @@ class bittorrent : public QObject {
QString filterPath;
bool queueingEnabled;
QStringList url_skippingDlg;
QHash<QString, QString> savepath_fromurl;
protected:
QString getSavePath(QString hash);
@@ -107,19 +108,22 @@ class bittorrent : public QObject {
QStringList getConsoleMessages() const;
QStringList getPeerBanMessages() const;
qlonglong getETA(QString hash) const;
bool useTemporaryFolder() const;
QString getDefaultSavePath() const;
public slots:
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
QTorrentHandle addMagnetUri(QString magnet_uri, bool resumed=false);
void loadSessionState();
void saveSessionState();
void downloadFromUrl(QString url);
void downloadFromURLList(const QStringList& url_list);
void deleteTorrent(QString hash, bool permanent = false);
void startUpTorrents();
/* Needed by Web UI */
void pauseAllTorrents();
void resumeAllTorrents();
void pauseTorrent(QString hash);
void resumeTorrent(QString hash);
void resumeAllTorrents();
/* End Web UI */
void saveDHTEntry();
void preAllocateAllFiles(bool b);
@@ -129,15 +133,13 @@ class bittorrent : public QObject {
void enableIPFilter(QString filter);
void disableIPFilter();
void setQueueingEnabled(bool enable);
void resumeUnfinishedTorrents();
void saveTorrentPriority(QString hash, int prio);
void saveTorrentSpeedLimits(QString hash);
void loadTorrentSpeedLimits(QString hash);
void handleDownloadFailure(QString url, QString reason);
void loadWebSeeds(QString fileHash);
void increaseDlTorrentPriority(QString hash);
void decreaseDlTorrentPriority(QString hash);
void downloadUrlAndSkipDialog(QString);
void downloadUrlAndSkipDialog(QString url, QString save_path=QString::null);
// Session configuration - Setters
void setListeningPortsRange(std::pair<unsigned short, unsigned short> ports);
void setMaxConnections(int maxConnec);
@@ -164,12 +166,13 @@ class bittorrent : public QObject {
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
void addPeerBanMessage(QString msg, bool from_ipfilter);
void processDownloadedFile(QString, QString);
void saveTrackerFile(QString hash);
void addMagnetSkipAddDlg(QString uri);
protected slots:
void scanDirectory(QString);
void readAlerts();
bool loadTrackerFile(QString hash);
void saveTrackerFile(QString hash);
void loadTrackerFile(QString hash);
void deleteBigRatios();
signals:
@@ -185,6 +188,8 @@ class bittorrent : public QObject {
void updateFileSize(QString hash);
void downloadFromUrlFailure(QString url, QString reason);
void torrentFinishedChecking(QTorrentHandle& h);
void metadataReceived(QTorrentHandle &h);
void torrentPaused(QTorrentHandle &h);
};
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -36,6 +36,7 @@
#include <QString>
#include <QRegExp>
#include <QStringList>
#include <QClipboard>
#include "ui_downloadFromURL.h"
class downloadFromURL : public QDialog, private Ui::downloadFromURL{
@@ -47,6 +48,11 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
setAttribute(Qt::WA_DeleteOnClose);
icon_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/url.png")));
show();
// Paste clipboard if there is an URL in it
QString clip_txt = qApp->clipboard()->text();
if(clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive)) {
textUrls->setText(clip_txt);
}
}
~downloadFromURL(){}

View File

@@ -158,7 +158,9 @@ downloadThread::~downloadThread(){
abort = true;
condition.wakeOne();
mutex.unlock();
//qDebug("downloadThread deleting subthreads...");
qDeleteAll(subThreads);
//qDebug("downloadThread deleted subthreads");
wait();
}
@@ -174,28 +176,36 @@ void downloadThread::downloadUrl(QString url){
void downloadThread::run(){
forever{
if(abort)
if(abort) {
qDebug("DownloadThread aborting...");
return;
}
mutex.lock();
if(!urls_queue.empty() && subThreads.size() < MAX_THREADS){
QString url = urls_queue.dequeue();
mutex.unlock();
//qDebug("DownloadThread downloading %s...", url.toLocal8Bit().data());
subDownloadThread *st = new subDownloadThread(0, url);
subThreads << st;
connect(st, SIGNAL(downloadFinishedST(subDownloadThread*, QString, QString)), this, SLOT(propagateDownloadedFile(subDownloadThread*, QString, QString)));
connect(st, SIGNAL(downloadFailureST(subDownloadThread*, QString, QString)), this, SLOT(propagateDownloadFailure(subDownloadThread*, QString, QString)));
st->start();
}else{
//qDebug("DownloadThread sleeping...");
condition.wait(&mutex);
//qDebug("DownloadThread woke up");
mutex.unlock();
}
}
}
void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url, QString path){
qDebug("Downloading %s was successful", url.toLocal8Bit().data());
mutex.lock();
int index = subThreads.indexOf(st);
Q_ASSERT(index != -1);
subThreads.removeAt(index);
mutex.unlock();
delete st;
emit downloadFinished(url, path);
mutex.lock();
@@ -206,9 +216,12 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url,
}
void downloadThread::propagateDownloadFailure(subDownloadThread* st, QString url, QString reason){
qDebug("Downloading %s failed", url.toLocal8Bit().data());
mutex.lock();
int index = subThreads.indexOf(st);
Q_ASSERT(index != -1);
subThreads.removeAt(index);
mutex.unlock();
delete st;
emit downloadFailure(url, reason);
mutex.lock();

Some files were not shown because too many files have changed in this diff Show More