From c3921ce2fefb259a61bbe2d76fdc0cfc55c63794 Mon Sep 17 00:00:00 2001 From: ngosang Date: Wed, 23 Sep 2015 19:18:46 +0200 Subject: [PATCH] Fix RSS crash when deleting RSS feeds. Closes #997, #2152, #2461, #3718, #3747, #3766, #3806, #3814, #3829 and #3846. --- src/gui/rss/rss_imp.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/rss/rss_imp.cpp b/src/gui/rss/rss_imp.cpp index 708f5e147..409a0a83c 100644 --- a/src/gui/rss/rss_imp.cpp +++ b/src/gui/rss/rss_imp.cpp @@ -258,11 +258,6 @@ void RSSImp::deleteSelectedItems() return; foreach (QTreeWidgetItem* item, selectedItems) { - if (m_feedList->currentFeed() == item) { - textBrowser->clear(); - m_currentArticle = 0; - listArticles->clear(); - } if (item == m_feedList->stickyUnreadItem()) continue; RssFilePtr rss_item = m_feedList->getRSSItem(item); @@ -285,6 +280,9 @@ void RSSImp::deleteSelectedItems() m_rssManager->saveStreamList(); // Update Unread items updateItemInfos(m_feedList->stickyUnreadItem()); + if (m_feedList->currentItem() == m_feedList->stickyUnreadItem()) + populateArticleList(m_feedList->stickyUnreadItem()); + } void RSSImp::loadFoldersOpenState() @@ -571,8 +569,10 @@ void RSSImp::refreshTextBrowser() if (item == m_currentArticle) return; m_currentArticle = item; - RssFeedPtr stream = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString()); - RssArticlePtr article = stream->getItem(item->data(Article::IdRole).toString()); + RssFeedPtr feed = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString()); + if (!feed) return; + RssArticlePtr article = feed->getItem(item->data(Article::IdRole).toString()); + if (!article) return; QString html; html += "
"; html += "
" + article->title() + "
";