Browse Source

Merge pull request #3849 from ngosang/fix_rss_crash

Fix RSS crash when deleting RSS feeds. Closes #3846
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
79617949c1
  1. 14
      src/gui/rss/rss_imp.cpp

14
src/gui/rss/rss_imp.cpp

@ -258,11 +258,6 @@ void RSSImp::deleteSelectedItems() @@ -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() @@ -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() @@ -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 += "<div style='border: 2px solid red; margin-left: 5px; margin-right: 5px; margin-bottom: 5px;'>";
html += "<div style='background-color: #678db2; font-weight: bold; color: #fff;'>" + article->title() + "</div>";

Loading…
Cancel
Save