From 1a9e97ee3bca260b101f6748e4b0e25a2a76e1e5 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Tue, 23 Mar 2021 13:17:36 +0300 Subject: [PATCH] Don't cause QHash relayout while using reference to its node --- src/base/rss/rss_parser.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/base/rss/rss_parser.cpp b/src/base/rss/rss_parser.cpp index 4948518e7..ed990f990 100644 --- a/src/base/rss/rss_parser.cpp +++ b/src/base/rss/rss_parser.cpp @@ -823,21 +823,24 @@ void Parser::addArticle(QVariantHash article) { QVariant &torrentURL = article[Article::KeyTorrentURL]; if (torrentURL.toString().isEmpty()) - torrentURL = article[Article::KeyLink]; + torrentURL = article.value(Article::KeyLink); // If item does not have an ID, fall back to some other identifier. QVariant &localId = article[Article::KeyId]; - if (localId.toString().isEmpty()) - localId = article.value(Article::KeyTorrentURL); - if (localId.toString().isEmpty()) - localId = article.value(Article::KeyTitle); - if (localId.toString().isEmpty()) { - // The article could not be uniquely identified - // since it has no appropriate data. - // Just ignore it. - return; + localId = article.value(Article::KeyTorrentURL); + if (localId.toString().isEmpty()) + { + localId = article.value(Article::KeyTitle); + if (localId.toString().isEmpty()) + { + // The article could not be uniquely identified + // since it has no appropriate data. + // Just ignore it. + return; + } + } } if (m_articleIDs.contains(localId.toString()))