diff --git a/src/rss.cpp b/src/rss.cpp index dd86e80ef..53850abc3 100644 --- a/src/rss.cpp +++ b/src/rss.cpp @@ -604,7 +604,7 @@ void RssStream::resizeList() { unsigned int max_articles = settings.value(QString::fromUtf8("Preferences/RSS/RSSMaxArticlesPerFeed"), 100).toInt(); unsigned int nb_articles = this->size(); if(nb_articles > max_articles) { - QList listItem = sortNewsList(this->values()); + QList listItem = RssManager::sortNewsList(this->values()); int excess = nb_articles - max_articles; for(int i=0; i &list, RssItem *item) { + int i = 0; + while(i < list.size() && item->getDate() < list.at(i)->getDate()) { + ++i; + } + list.insert(i, item); + } + + static QList sortNewsList(QList news_list) { + QList new_list; + foreach(RssItem *item, news_list) { + insertSortElem(new_list, item); + } + return new_list; + } }; -static void insertSortElem(QList &list, RssItem *item) { - int i = 0; - while(i < list.size() && item->getDate() < list.at(i)->getDate()) { - ++i; - } - list.insert(i, item); -} -static QList sortNewsList(QList news_list) { - QList new_list; - foreach(RssItem *item, news_list) { - insertSortElem(new_list, item); - } - return new_list; -} + #endif diff --git a/src/rss_imp.cpp b/src/rss_imp.cpp index 7e484af39..814325085 100644 --- a/src/rss_imp.cpp +++ b/src/rss_imp.cpp @@ -431,9 +431,9 @@ void RSSImp::refreshNewsList(QTreeWidgetItem* item) { qDebug("Getting the list of news"); QList news; if(rss_item == rssmanager) - news = sortNewsList(rss_item->getUnreadNewsList()); + news = RssManager::sortNewsList(rss_item->getUnreadNewsList()); else - news = sortNewsList(rss_item->getNewsList()); + news = RssManager::sortNewsList(rss_item->getNewsList()); // Clear the list first textBrowser->clear(); previous_news = 0;