mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
RSS optimizations
This commit is contained in:
parent
f0f7924325
commit
3bc75bb068
7 changed files with 27 additions and 34 deletions
|
@ -123,8 +123,8 @@ void RssFeed::removeAllSettings() {
|
|||
}
|
||||
}
|
||||
|
||||
bool RssFeed::itemAlreadyExists(const QString &hash) const {
|
||||
return m_articles.contains(hash);
|
||||
bool RssFeed::itemAlreadyExists(const QString &guid) const {
|
||||
return m_articles.contains(guid);
|
||||
}
|
||||
|
||||
void RssFeed::setLoading(bool val) {
|
||||
|
@ -177,8 +177,8 @@ void RssFeed::setIconPath(const QString &path) {
|
|||
m_icon = path;
|
||||
}
|
||||
|
||||
RssArticle& RssFeed::getItem(const QString &id) {
|
||||
return m_articles[id];
|
||||
RssArticle& RssFeed::getItem(const QString &guid) {
|
||||
return m_articles[guid];
|
||||
}
|
||||
|
||||
uint RssFeed::count() const{
|
||||
|
@ -323,10 +323,11 @@ void RssFeed::resizeList() {
|
|||
const uint max_articles = RssSettings().getRSSMaxArticlesPerFeed();
|
||||
const uint nb_articles = m_articles.size();
|
||||
if(nb_articles > max_articles) {
|
||||
const QList<RssArticle> listItem = RssManager::sortNewsList(m_articles.values());
|
||||
QList<RssArticle> listItems = m_articles.values();
|
||||
RssManager::sortNewsList(listItems);
|
||||
const int excess = nb_articles - max_articles;
|
||||
for(uint i=nb_articles-excess; i<nb_articles; ++i){
|
||||
m_articles.remove(listItem.at(i).guid());
|
||||
m_articles.remove(listItems.at(i).guid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue