Browse Source

- Do not update the icon when clicking "Mark all as read" on a feed that is still loading

- Added some more debug messages
adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
7a59d5e47c
  1. 4
      src/downloadThread.cpp
  2. 7
      src/rss.cpp
  3. 1
      src/rss_imp.cpp

4
src/downloadThread.cpp

@ -141,6 +141,7 @@ void subDownloadThread::run(){ @@ -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(){ @@ -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, @@ -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, @@ -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){

7
src/rss.cpp

@ -137,8 +137,12 @@ void RssFolder::refreshStream(QString url) { @@ -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) { @@ -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()){

1
src/rss_imp.cpp

@ -503,6 +503,7 @@ void RSSImp::updateFeedInfos(QString url, QString aliasOrUrl, unsigned int nbUnr @@ -503,6 +503,7 @@ 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(")"));
if(!stream->isLoading())
item->setData(0,Qt::DecorationRole, QVariant(QIcon(stream->getIconPath())));
// Update parent
if(item->parent())

Loading…
Cancel
Save