Browse Source

[RSS] Don't hide the elements in Unread list when clicked

adaptive-webui-19844
ngosang 9 years ago
parent
commit
7c7da44622
  1. 24
      src/gui/rss/rss_imp.cpp

24
src/gui/rss/rss_imp.cpp

@ -547,17 +547,8 @@ void RSSImp::refreshTextBrowser()
QListWidgetItem *item = selection.first(); QListWidgetItem *item = selection.first();
Q_ASSERT(item); Q_ASSERT(item);
if (item == m_currentArticle) return; if (item == m_currentArticle) return;
// Stop displaying previous news if necessary m_currentArticle = item;
if (m_feedList->currentFeed() == m_feedList->stickyUnreadItem()) {
if (m_currentArticle) {
disconnect(listArticles, SIGNAL(itemSelectionChanged()), this, SLOT(refreshTextBrowser()));
listArticles->removeItemWidget(m_currentArticle);
Q_ASSERT(m_currentArticle);
delete m_currentArticle;
connect(listArticles, SIGNAL(itemSelectionChanged()), this, SLOT(refreshTextBrowser()));
}
m_currentArticle = item;
}
RssFeedPtr stream = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString()); RssFeedPtr stream = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString());
RssArticlePtr article = stream->getItem(item->data(Article::IdRole).toString()); RssArticlePtr article = stream->getItem(item->data(Article::IdRole).toString());
QString html; QString html;
@ -680,14 +671,11 @@ void RSSImp::onFeedContentChanged(const QString& url)
qDebug() << Q_FUNC_INFO << url; qDebug() << Q_FUNC_INFO << url;
QTreeWidgetItem *item = m_feedList->getTreeItemFromUrl(url); QTreeWidgetItem *item = m_feedList->getTreeItemFromUrl(url);
// If the feed is selected, update the displayed news // If the feed is selected, update the displayed news
if (m_feedList->currentItem() == item ) { if (m_feedList->currentItem() == item)
populateArticleList(item); populateArticleList(item);
} // Update unread items
else { else if (m_feedList->currentItem() == m_feedList->stickyUnreadItem())
// Update unread items populateArticleList(m_feedList->stickyUnreadItem());
if (m_feedList->currentItem() == m_feedList->stickyUnreadItem())
populateArticleList(m_feedList->stickyUnreadItem());
}
} }
void RSSImp::updateRefreshInterval(uint val) void RSSImp::updateRefreshInterval(uint val)

Loading…
Cancel
Save