mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
- Be less restrictive about RSS feeds, we now display articles even if they don't have embedded torrents. However, RSS feed downloader is not available for said feeds.
- Added an icon to differenciate articles with attachment (torrent)
This commit is contained in:
parent
9d35bda43c
commit
6f89b1f131
6 changed files with 94 additions and 45 deletions
15
src/rss.h
15
src/rss.h
|
@ -268,18 +268,10 @@ public:
|
|||
is_valid = false;
|
||||
return;
|
||||
}
|
||||
if(!torrent_url.isEmpty())
|
||||
is_valid = true;
|
||||
}
|
||||
else if (property.tagName() == "enclosure") {
|
||||
if(property.attribute("type", "") == "application/x-bittorrent") {
|
||||
torrent_url = property.attribute("url", QString::null);
|
||||
if(torrent_url.isNull()) {
|
||||
qDebug("Error: Torrent URL is null");
|
||||
return;
|
||||
}
|
||||
if(!title.isEmpty())
|
||||
is_valid = true;
|
||||
}
|
||||
}
|
||||
else if (property.tagName() == "link")
|
||||
|
@ -292,6 +284,7 @@ public:
|
|||
author = property.text();
|
||||
property = property.nextSibling().toElement();
|
||||
}
|
||||
is_valid = true;
|
||||
}
|
||||
|
||||
RssItem(RssStream* parent, QString _title, QString _torrent_url, QString _news_link, QString _description, QDateTime _date, QString _author, bool _read):
|
||||
|
@ -307,6 +300,10 @@ public:
|
|||
~RssItem(){
|
||||
}
|
||||
|
||||
bool has_attachment() const {
|
||||
return !torrent_url.isEmpty();
|
||||
}
|
||||
|
||||
QHash<QString, QVariant> toHash() const {
|
||||
QHash<QString, QVariant> item;
|
||||
item["title"] = title;
|
||||
|
@ -388,6 +385,7 @@ private:
|
|||
bool refreshed;
|
||||
bool downloadFailure;
|
||||
bool currently_loading;
|
||||
bool has_attachments;
|
||||
|
||||
public slots:
|
||||
void processDownloadedFile(QString file_path);
|
||||
|
@ -423,6 +421,7 @@ public:
|
|||
QList<RssItem*> getNewsList() const;
|
||||
QList<RssItem*> getUnreadNewsList() const;
|
||||
QString getIconUrl();
|
||||
bool hasAttachments() const { return has_attachments; }
|
||||
|
||||
private:
|
||||
short readDoc(const QDomDocument& doc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue