- Multithreaded deletionThread (harmonized with deleteThread)

This commit is contained in:
Christophe Dumez 2007-07-31 08:52:04 +00:00
parent 5518144b26
commit 570296c29e
4 changed files with 108 additions and 26 deletions

View file

@ -194,20 +194,16 @@ class downloadThread : public QThread {
protected slots:
void propagateDownloadedFile(subDownloadThread* st, QString url, QString path){
int index = subThreads.indexOf(st);
if(index == -1)
std::cerr << "ERROR: Couldn't delete download subThread!\n";
else
subThreads.takeAt(index);
Q_ASSERT(index != -1);
subThreads.removeAt(index);
delete st;
emit downloadFinished(url, path);
}
void propagateDownloadFailure(subDownloadThread* st, QString url, QString reason){
int index = subThreads.indexOf(st);
if(index == -1)
std::cerr << "ERROR: Couldn't delete download subThread!\n";
else
subThreads.takeAt(index);
Q_ASSERT(index != -1);
subThreads.removeAt(index);
delete st;
emit downloadFailure(url, reason);
}