mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 13:58:51 +03:00
Fix RSS crash when deleting RSS feeds. Closes #997, #2152, #2461, #3718, #3747, #3766, #3806, #3814, #3829 and #3846.
This commit is contained in:
parent
ef39fb0709
commit
c3921ce2fe
1 changed files with 7 additions and 7 deletions
|
@ -258,11 +258,6 @@ void RSSImp::deleteSelectedItems()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (QTreeWidgetItem* item, selectedItems) {
|
foreach (QTreeWidgetItem* item, selectedItems) {
|
||||||
if (m_feedList->currentFeed() == item) {
|
|
||||||
textBrowser->clear();
|
|
||||||
m_currentArticle = 0;
|
|
||||||
listArticles->clear();
|
|
||||||
}
|
|
||||||
if (item == m_feedList->stickyUnreadItem())
|
if (item == m_feedList->stickyUnreadItem())
|
||||||
continue;
|
continue;
|
||||||
RssFilePtr rss_item = m_feedList->getRSSItem(item);
|
RssFilePtr rss_item = m_feedList->getRSSItem(item);
|
||||||
|
@ -285,6 +280,9 @@ void RSSImp::deleteSelectedItems()
|
||||||
m_rssManager->saveStreamList();
|
m_rssManager->saveStreamList();
|
||||||
// Update Unread items
|
// Update Unread items
|
||||||
updateItemInfos(m_feedList->stickyUnreadItem());
|
updateItemInfos(m_feedList->stickyUnreadItem());
|
||||||
|
if (m_feedList->currentItem() == m_feedList->stickyUnreadItem())
|
||||||
|
populateArticleList(m_feedList->stickyUnreadItem());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSSImp::loadFoldersOpenState()
|
void RSSImp::loadFoldersOpenState()
|
||||||
|
@ -571,8 +569,10 @@ void RSSImp::refreshTextBrowser()
|
||||||
if (item == m_currentArticle) return;
|
if (item == m_currentArticle) return;
|
||||||
m_currentArticle = item;
|
m_currentArticle = item;
|
||||||
|
|
||||||
RssFeedPtr stream = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString());
|
RssFeedPtr feed = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString());
|
||||||
RssArticlePtr article = stream->getItem(item->data(Article::IdRole).toString());
|
if (!feed) return;
|
||||||
|
RssArticlePtr article = feed->getItem(item->data(Article::IdRole).toString());
|
||||||
|
if (!article) return;
|
||||||
QString html;
|
QString html;
|
||||||
html += "<div style='border: 2px solid red; margin-left: 5px; margin-right: 5px; margin-bottom: 5px;'>";
|
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>";
|
html += "<div style='background-color: #678db2; font-weight: bold; color: #fff;'>" + article->title() + "</div>";
|
||||||
|
|
Loading…
Reference in a new issue