From 4e376881059d3396f40e762e1de050b99b1e583e Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Thu, 4 May 2017 12:30:02 +0300 Subject: [PATCH] Properly clear ArticleListWidget --- src/gui/rss/feedlistwidget.cpp | 2 ++ src/gui/rss/rsswidget.cpp | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gui/rss/feedlistwidget.cpp b/src/gui/rss/feedlistwidget.cpp index bf67f3c88..b4a2b5650 100644 --- a/src/gui/rss/feedlistwidget.cpp +++ b/src/gui/rss/feedlistwidget.cpp @@ -164,6 +164,8 @@ QList FeedListWidget::getAllOpenedFolders(QTreeWidgetItem *pa RSS::Item *FeedListWidget::getRSSItem(QTreeWidgetItem *item) const { + if (!item) return nullptr; + return reinterpret_cast(item->data(0, Qt::UserRole).value()); } diff --git a/src/gui/rss/rsswidget.cpp b/src/gui/rss/rsswidget.cpp index 59d204f47..d2524bc87 100644 --- a/src/gui/rss/rsswidget.cpp +++ b/src/gui/rss/rsswidget.cpp @@ -416,11 +416,6 @@ void RSSWidget::copySelectedFeedsURL() void RSSWidget::handleCurrentFeedItemChanged(QTreeWidgetItem *currentItem) { - if (!currentItem) { - m_articleListWidget->clear(); - return; - } - m_articleListWidget->setRSSItem(m_feedListWidget->getRSSItem(currentItem) , (currentItem == m_feedListWidget->stickyUnreadItem())); }