mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 04:24:23 +00:00
- Added rss download failure handling (display red cross next to the stream name)
This commit is contained in:
parent
2789316e38
commit
f81e431032
1
TODO
1
TODO
@ -43,7 +43,6 @@
|
|||||||
- Allow to hide columns (gtsoul)
|
- Allow to hide columns (gtsoul)
|
||||||
- Complete documentation and english translation
|
- Complete documentation and english translation
|
||||||
* beta2
|
* beta2
|
||||||
- Handle downloadFromUrl errors (Display a messagebox to catch user's attention)
|
|
||||||
- Wait for some bug fixes in libtorrent :
|
- Wait for some bug fixes in libtorrent :
|
||||||
- upload/download limit per torrent
|
- upload/download limit per torrent
|
||||||
- ipfilter crash
|
- ipfilter crash
|
||||||
|
BIN
src/Icons/unavailable.png
Normal file
BIN
src/Icons/unavailable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 888 B |
@ -34,6 +34,7 @@
|
|||||||
<file>Icons/sphere.png</file>
|
<file>Icons/sphere.png</file>
|
||||||
<file>Icons/sphere2.png</file>
|
<file>Icons/sphere2.png</file>
|
||||||
<file>Icons/password.png</file>
|
<file>Icons/password.png</file>
|
||||||
|
<file>Icons/unavailable.png</file>
|
||||||
<file>Icons/flags/portugal.png</file>
|
<file>Icons/flags/portugal.png</file>
|
||||||
<file>Icons/flags/france.png</file>
|
<file>Icons/flags/france.png</file>
|
||||||
<file>Icons/flags/ukraine.png</file>
|
<file>Icons/flags/ukraine.png</file>
|
||||||
|
12
src/rss.h
12
src/rss.h
@ -189,6 +189,7 @@ class RssStream : public QObject{
|
|||||||
downloaderRss = new downloadThread(this);
|
downloaderRss = new downloadThread(this);
|
||||||
downloaderIcon = 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(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);
|
downloaderRss->downloadUrl(url);
|
||||||
// XXX: remove it when gif can be displayed
|
// XXX: remove it when gif can be displayed
|
||||||
iconPath = ":/Icons/rss.png";
|
iconPath = ":/Icons/rss.png";
|
||||||
@ -299,11 +300,11 @@ class RssStream : public QObject{
|
|||||||
// is it a rss file ?
|
// is it a rss file ?
|
||||||
QDomElement root = doc.documentElement();
|
QDomElement root = doc.documentElement();
|
||||||
if(root.tagName() == "html"){
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
else if(root.tagName() != "rss"){
|
else if(root.tagName() != "rss"){
|
||||||
qDebug("the file is not a rss stream, <rss> omitted"+root.tagName().toUtf8());
|
qDebug("the file is not a rss stream, <rss> omitted: %s", (const char*)root.tagName().toUtf8());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
QDomNode rss = root.firstChild();
|
QDomNode rss = root.firstChild();
|
||||||
@ -408,6 +409,13 @@ class RssStream : public QObject{
|
|||||||
return;
|
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
|
// global class, manage the whole rss stream
|
||||||
|
Loading…
x
Reference in New Issue
Block a user