QList<IDownload*> DownloadManager::getDownloads() const { QList<IDownload*> listDownloads; // TODO: very heavy! for (int i = 0; i < this->downloadQueue.size(); i++) { Download* download = this->downloadQueue[i]; if (download->getStatus() != DELETED) listDownloads << download; } return listDownloads; }
QList<IDownload*> DownloadManager::getDownloads() const { QList<IDownload*> listDownloads; // A bit heavy . . . listDownloads.reserve(this->downloadQueue.size()); for (int i = 0; i < this->downloadQueue.size(); i++) { Download* download = this->downloadQueue[i]; if (download->getStatus() != DELETED) listDownloads << download; } return listDownloads; }