From f81e431032aef42fa93e4bafecf0ad1627864292 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Fri, 20 Jul 2007 21:06:50 +0000 Subject: [PATCH] - Added rss download failure handling (display red cross next to the stream name) --- TODO | 1 - src/Icons/unavailable.png | Bin 0 -> 888 bytes src/icons.qrc | 1 + src/rss.h | 12 ++++++++++-- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/Icons/unavailable.png diff --git a/TODO b/TODO index 10b5d6033..f4032783c 100644 --- a/TODO +++ b/TODO @@ -43,7 +43,6 @@ - Allow to hide columns (gtsoul) - Complete documentation and english translation * beta2 - - Handle downloadFromUrl errors (Display a messagebox to catch user's attention) - Wait for some bug fixes in libtorrent : - upload/download limit per torrent - ipfilter crash diff --git a/src/Icons/unavailable.png b/src/Icons/unavailable.png new file mode 100644 index 0000000000000000000000000000000000000000..b2cc9be41452c0b0690ec99fb3159ea031645b23 GIT binary patch literal 888 zcmV-;1Bd*HP)OcNoV%@7uS~f4;PDyD}=KXBpMAk(wUGX1n}GRv{+tQ z`SH%e!WRJYe&x?~eK>IWvZS3pjlHXjN})hybCb&ECgoxgM|U?Jx=!zn8&c5W82&mQ z9|4djG)*-Nh5K4GDs{zTSZy}cK!A>uC;3n;QZAM7o;!!y*@?sL=Ci&&ywRv+FBI-4 zG)+}}x<2-CanV`Z-KDy_i`8xiz#9rtGYs0CPTYY&Ym{20f@v5yvsvevSZqwOC`wEM zwx2&|vDxJOty_4G9|s_C_Uxg5$iIBa>eLi_^YgR;E=3uzBz(Sa8e3Z(MlOfEx5t}w z8eb%W!|gtl{3e}dd3+q}{5+M_RV+gA!RNCm&3^-$rb#}Tq`lds`u;rxgNF!qUcbgn zCTUw+!zBa?U;$)owhXfTX;nQv3_g6wiAaQ_=(}=-?tAwrd%ZXTr^Q0UX3NS(y}oF5 zxv2a73_W>5Xkeg~^w-=R`Anu|$F5(;H#tdNQE;j%f7k0NzVvw12jOt}@!+8NXc%H2 ze?EIAW+3E5+l>wJ%cV|eIQL$JujvX6qZf%K~+qbDztE8Vk z<@cL6IkCP@WMzfqwQJ;Gy<+FxJN}rQ#GcEEHBB2`E*49zQ~ov{p9z@ea7Q>S)t8p= zzj%QPpPnqUaq%MU{ryODbK)nPt#!(W#B?_vAL*=CzdNHS4$bSuR;%Gq6zuKo$lKfe zy0=$JIvk@D|0kw>Bs5Juuj^x8t2O2_&0Y&owOTVd(@g!G&5kb}k@G(*zFP~W^S&DZ O0000Icons/sphere.png Icons/sphere2.png Icons/password.png + Icons/unavailable.png Icons/flags/portugal.png Icons/flags/france.png Icons/flags/ukraine.png diff --git a/src/rss.h b/src/rss.h index df8dd508b..15ddc2279 100644 --- a/src/rss.h +++ b/src/rss.h @@ -189,6 +189,7 @@ class RssStream : public QObject{ downloaderRss = new downloadThread(this); downloaderIcon = new downloadThread(this); connect(downloaderRss, SIGNAL(downloadFinished(const QString&, const QString&)), this, SLOT(processDownloadedFile(const QString&, const QString&))); + connect(downloaderRss, SIGNAL(downloadFailure(const QString&, const QString&)), this, SLOT(handleDownloadFailure(const QString&, const QString&))); downloaderRss->downloadUrl(url); // XXX: remove it when gif can be displayed iconPath = ":/Icons/rss.png"; @@ -299,11 +300,11 @@ class RssStream : public QObject{ // is it a rss file ? QDomElement root = doc.documentElement(); if(root.tagName() == "html"){ - qDebug("the file is empty, maybe the url is wrong or the server is too busy"); + qDebug("the file is empty, maybe the url is invalid or the server is too busy"); return -1; } else if(root.tagName() != "rss"){ - qDebug("the file is not a rss stream, omitted"+root.tagName().toUtf8()); + qDebug("the file is not a rss stream, omitted: %s", (const char*)root.tagName().toUtf8()); return -1; } QDomNode rss = root.firstChild(); @@ -408,6 +409,13 @@ class RssStream : public QObject{ return; } } + + protected slots: + void handleDownloadFailure(const QString&, const QString&){ + // Change the stream icon to a red cross + iconPath = ":/Icons/unavailable.png"; + emit refreshFinished(url, ICON); + } }; // global class, manage the whole rss stream