diff --git a/src/downloadThread.cpp b/src/downloadThread.cpp index dd525f9f9..2f90c74a4 100644 --- a/src/downloadThread.cpp +++ b/src/downloadThread.cpp @@ -141,6 +141,7 @@ void subDownloadThread::run(){ qDebug("Downloading %s", url.toLocal8Bit().data()); if(!abort) res = curl_easy_perform(curl); + qDebug("done downloading %s", url.toLocal8Bit().data()); /* always cleanup */ curl_easy_cleanup(curl); fclose(f); @@ -151,6 +152,7 @@ void subDownloadThread::run(){ } else { emit downloadFinishedST(this, url, filePath); } + qDebug("%s Raised the signal", url.toLocal8Bit().data()); } else { std::cerr << "Could not initialize CURL" << "\n"; } @@ -213,6 +215,7 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url, Q_ASSERT(index != -1); subThreads.removeAt(index); mutex.unlock(); + qDebug("Deleting subthread"); delete st; emit downloadFinished(url, path); mutex.lock(); @@ -220,6 +223,7 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url, condition.wakeOne(); } mutex.unlock(); + qDebug("Out of propagateDownloadedFile"); } void downloadThread::propagateDownloadFailure(subDownloadThread* st, QString url, QString reason){ diff --git a/src/rss.cpp b/src/rss.cpp index edc128bd7..c276bd67b 100644 --- a/src/rss.cpp +++ b/src/rss.cpp @@ -137,8 +137,12 @@ void RssFolder::refreshStream(QString url) { qDebug("Refreshing feed: %s", url.toLocal8Bit().data()); Q_ASSERT(this->contains(url)); RssStream *stream = (RssStream*)this->value(url); - if(stream->isLoading()) return; + if(stream->isLoading()) { + qDebug("Stream %s is already being loaded...", stream->getUrl().toLocal8Bit().data()); + return; + } stream->setLoading(true); + qDebug("stream %s : loaded=true", stream->getUrl().toLocal8Bit().data()); downloader->downloadUrl(url); if(!stream->hasCustomIcon()){ downloader->downloadUrl(stream->getIconUrl()); @@ -186,6 +190,7 @@ void RssFolder::processFinishedDownload(QString url, QString path) { } stream->processDownloadedFile(path); stream->setLoading(false); + qDebug("stream %s : loaded=false", stream->getUrl().toLocal8Bit().data()); // If the feed has no alias, then we use the title as Alias // this is more user friendly if(stream->getName().isEmpty()){ diff --git a/src/rss_imp.cpp b/src/rss_imp.cpp index 78abf8782..e19b1332a 100644 --- a/src/rss_imp.cpp +++ b/src/rss_imp.cpp @@ -503,7 +503,8 @@ void RSSImp::updateFeedInfos(QString url, QString aliasOrUrl, unsigned int nbUnr QTreeWidgetItem *item = listStreams->getTreeItemFromUrl(url); RssStream *stream = (RssStream*)listStreams->getRSSItem(item); item->setText(0, aliasOrUrl + QString::fromUtf8(" (") + QString::number(nbUnread, 10)+ QString(")")); - item->setData(0,Qt::DecorationRole, QVariant(QIcon(stream->getIconPath()))); + if(!stream->isLoading()) + item->setData(0,Qt::DecorationRole, QVariant(QIcon(stream->getIconPath()))); // Update parent if(item->parent()) updateItemInfos(item->parent());