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. 3
      src/rss_imp.cpp

4
src/downloadThread.cpp

@ -141,6 +141,7 @@ void subDownloadThread::run(){
qDebug("Downloading %s", url.toLocal8Bit().data()); qDebug("Downloading %s", url.toLocal8Bit().data());
if(!abort) if(!abort)
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
qDebug("done downloading %s", url.toLocal8Bit().data());
/* always cleanup */ /* always cleanup */
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
fclose(f); fclose(f);
@ -151,6 +152,7 @@ void subDownloadThread::run(){
} else { } else {
emit downloadFinishedST(this, url, filePath); emit downloadFinishedST(this, url, filePath);
} }
qDebug("%s Raised the signal", url.toLocal8Bit().data());
} else { } else {
std::cerr << "Could not initialize CURL" << "\n"; std::cerr << "Could not initialize CURL" << "\n";
} }
@ -213,6 +215,7 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url,
Q_ASSERT(index != -1); Q_ASSERT(index != -1);
subThreads.removeAt(index); subThreads.removeAt(index);
mutex.unlock(); mutex.unlock();
qDebug("Deleting subthread");
delete st; delete st;
emit downloadFinished(url, path); emit downloadFinished(url, path);
mutex.lock(); mutex.lock();
@ -220,6 +223,7 @@ void downloadThread::propagateDownloadedFile(subDownloadThread* st, QString url,
condition.wakeOne(); condition.wakeOne();
} }
mutex.unlock(); mutex.unlock();
qDebug("Out of propagateDownloadedFile");
} }
void downloadThread::propagateDownloadFailure(subDownloadThread* st, QString url, QString reason){ void downloadThread::propagateDownloadFailure(subDownloadThread* st, QString url, QString reason){

7
src/rss.cpp

@ -137,8 +137,12 @@ void RssFolder::refreshStream(QString url) {
qDebug("Refreshing feed: %s", url.toLocal8Bit().data()); qDebug("Refreshing feed: %s", url.toLocal8Bit().data());
Q_ASSERT(this->contains(url)); Q_ASSERT(this->contains(url));
RssStream *stream = (RssStream*)this->value(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); stream->setLoading(true);
qDebug("stream %s : loaded=true", stream->getUrl().toLocal8Bit().data());
downloader->downloadUrl(url); downloader->downloadUrl(url);
if(!stream->hasCustomIcon()){ if(!stream->hasCustomIcon()){
downloader->downloadUrl(stream->getIconUrl()); downloader->downloadUrl(stream->getIconUrl());
@ -186,6 +190,7 @@ void RssFolder::processFinishedDownload(QString url, QString path) {
} }
stream->processDownloadedFile(path); stream->processDownloadedFile(path);
stream->setLoading(false); 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 // If the feed has no alias, then we use the title as Alias
// this is more user friendly // this is more user friendly
if(stream->getName().isEmpty()){ if(stream->getName().isEmpty()){

3
src/rss_imp.cpp

@ -503,7 +503,8 @@ void RSSImp::updateFeedInfos(QString url, QString aliasOrUrl, unsigned int nbUnr
QTreeWidgetItem *item = listStreams->getTreeItemFromUrl(url); QTreeWidgetItem *item = listStreams->getTreeItemFromUrl(url);
RssStream *stream = (RssStream*)listStreams->getRSSItem(item); RssStream *stream = (RssStream*)listStreams->getRSSItem(item);
item->setText(0, aliasOrUrl + QString::fromUtf8(" (") + QString::number(nbUnread, 10)+ QString(")")); 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 // Update parent
if(item->parent()) if(item->parent())
updateItemInfos(item->parent()); updateItemInfos(item->parent());

Loading…
Cancel
Save