1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 23:07:59 +00:00

- Make use of qDeleteAll() function from Qt4

This commit is contained in:
Christophe Dumez 2007-08-19 13:00:51 +00:00
parent 04352cce3c
commit de8c3158fe
3 changed files with 6 additions and 20 deletions

View File

@ -84,10 +84,7 @@ class deleteThread : public QThread {
abort = true; abort = true;
condition.wakeOne(); condition.wakeOne();
mutex.unlock(); mutex.unlock();
subDeleteThread *st; qDeleteAll(subThreads);
foreach(st, subThreads){
delete st;
}
wait(); wait();
} }

View File

@ -154,10 +154,7 @@ class downloadThread : public QThread {
abort = true; abort = true;
condition.wakeOne(); condition.wakeOne();
mutex.unlock(); mutex.unlock();
subDownloadThread *st; qDeleteAll(subThreads);
foreach(st, subThreads){
delete st;
}
wait(); wait();
} }

View File

@ -170,10 +170,8 @@ class RssStream : public QObject{
// delete all the items saved // delete all the items saved
void removeAllItems() { void removeAllItems() {
unsigned int listSize = listItem.size(); qDeleteAll(listItem);
for(unsigned int i=0; i<listSize; ++i){ listItem.clear();
delete listItem.at(i);
}
} }
void setLoading(bool val) { void setLoading(bool val) {
@ -466,10 +464,7 @@ class RssManager : public QObject{
} }
~RssManager(){ ~RssManager(){
RssStream *stream; qDeleteAll(streams);
foreach(stream, streams){
delete stream;
}
delete downloader; delete downloader;
} }
@ -560,10 +555,7 @@ class RssManager : public QObject{
// remove all the streams in the manager // remove all the streams in the manager
void removeAll(){ void removeAll(){
RssStream *stream; qDeleteAll(streams);
foreach(stream, streams){
delete stream;
}
streams.clear(); streams.clear();
} }