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 000000000..b2cc9be41
Binary files /dev/null and b/src/Icons/unavailable.png differ
diff --git a/src/icons.qrc b/src/icons.qrc
index cb15ecc74..7ef571f96 100644
--- a/src/icons.qrc
+++ b/src/icons.qrc
@@ -34,6 +34,7 @@
Icons/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