Browse Source

- Make use of qDeleteAll() function from Qt4

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
de8c3158fe
  1. 5
      src/deleteThread.h
  2. 5
      src/downloadThread.h
  3. 16
      src/rss.h

5
src/deleteThread.h

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

5
src/downloadThread.h

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

16
src/rss.h

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

Loading…
Cancel
Save