From e6e2baf3a81c2754e27a3345ccb39e1adaaca0d5 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 20 May 2012 14:01:34 +0300 Subject: [PATCH] RSS: Support items that don't have a guid (closes #1001777) --- src/rss/rssarticle.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/rss/rssarticle.cpp b/src/rss/rssarticle.cpp index 6105d1bec..920165377 100644 --- a/src/rss/rssarticle.cpp +++ b/src/rss/rssarticle.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -246,8 +247,17 @@ RssArticlePtr xmlToRssArticle(RssFeed* parent, QXmlStreamReader& xml) xml.skipCurrentElement(); } - if (guid.isEmpty()) - return RssArticlePtr(); + if (guid.isEmpty()) { + // Item does not have a guid, fall back to some other identifier + if (!link.isEmpty()) + guid = link; + else if (!title.isEmpty()) + guid = title; + else { + qWarning() << "Item has no guid, link or title, ignoring it..."; + return RssArticlePtr(); + } + } RssArticlePtr art(new RssArticle(parent, guid)); art->m_title = title;