Just a simple thought, why not using just one method for download (with simple pause mechanism) ?
void downloadNext(){
if( !downloadQueue.empty() and this->_processUrls ){
const QUrl url
= downloadQueue.
takeFirst();
downloadFile(url); // will emit finished signal connected to this method
// if you dont want to process urls anymore now, set this->_processUrls = false
// so it will pause after finishing current active download
}
}
void downloadNext(){
if( !downloadQueue.empty() and this->_processUrls ){
const QUrl url = downloadQueue.takeFirst();
downloadFile(url); // will emit finished signal connected to this method
// if you dont want to process urls anymore now, set this->_processUrls = false
// so it will pause after finishing current active download
}
}
To copy to clipboard, switch view to plain text mode
At the beginning just push back an Url to queue and start processing by calling downloadNext()
Bookmarks