1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| void GetRSSThread::run()
{
AppVars::urlRSSlist << "http://rss.lemonde.fr/c/205/f/3050/index.rss";
qDebug() << "enter run thread";
Sleep(10000);
QList<QNetworkAccessManager*> netManList;
netManList<< new QNetworkAccessManager();
connect (netManList[0], SIGNAL(finished(QNetworkReply*)), this, SLOT(downloadedRSSalaune(QNetworkReply*))) ;
for(int i=0;i<AppVars::urlRSSlist.size();i++){
qDebug() << "enter for loop for i = "+QString::number(i);
netManList[i]->get(QNetworkRequest(QUrl(AppVars::urlRSSlist[i])));
}
start :
qDebug() << "enter start loop thread";
Sleep(20000);
emit instantNews("monde","à l'autre bout du monde","http://www.google.fr");
Sleep(5000);
emit instantNews("monde","à l'autre bout du monde","http://www.google.fr");
goto start;
}
void GetRSSThread::downloadedRSSalaune(QNetworkReply* reply){
qDebug() << reply->errorString();
qDebug() << "fichier recu";
QByteArray data =QByteArray(reply->readAll());
[...]
} |
Partager