diff --git a/src/rss/rssdownloadrule.cpp b/src/rss/rssdownloadrule.cpp index 7b1b621cb..4c6623274 100644 --- a/src/rss/rssdownloadrule.cpp +++ b/src/rss/rssdownloadrule.cpp @@ -122,7 +122,10 @@ QStringList RssDownloadRule::findMatchingArticles(const RssFeedPtr& feed) const { QStringList ret; const RssArticleHash& feed_articles = feed->articleHash(); - for (RssArticleHash::ConstIterator artIt = feed_articles.begin(); artIt != feed_articles.end(); artIt++) { + + RssArticleHash::ConstIterator artIt = feed_articles.begin(); + RssArticleHash::ConstIterator artItend = feed_articles.end(); + for ( ; artIt != artItend ; ++artIt) { const QString title = artIt.value()->title(); if (matches(title)) ret << title; diff --git a/src/rss/rssdownloadrulelist.cpp b/src/rss/rssdownloadrulelist.cpp index ed5bf9311..be0cb6656 100644 --- a/src/rss/rssdownloadrulelist.cpp +++ b/src/rss/rssdownloadrulelist.cpp @@ -75,7 +75,9 @@ QVariantHash RssDownloadRuleList::toVariantHash() const void RssDownloadRuleList::loadRulesFromVariantHash(const QVariantHash &h) { - for (QVariantHash::ConstIterator it = h.begin(); it != h.end(); it++) { + QVariantHash::ConstIterator it = h.begin(); + QVariantHash::ConstIterator itend = h.end(); + for ( ; it != itend; ++it) { RssDownloadRulePtr rule = RssDownloadRule::fromVariantHash(it.value().toHash()); if (rule && !rule->name().isEmpty()) saveRule(rule); diff --git a/src/rss/rssfeed.cpp b/src/rss/rssfeed.cpp index cdd7ade8b..1064be30d 100644 --- a/src/rss/rssfeed.cpp +++ b/src/rss/rssfeed.cpp @@ -67,7 +67,10 @@ void RssFeed::saveItemsToDisk() { return; QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss"); QVariantList old_items; - for (RssArticleHash::ConstIterator it=m_articles.begin(); it != m_articles.end(); it++) { + + RssArticleHash::ConstIterator it=m_articles.begin(); + RssArticleHash::ConstIterator itend=m_articles.end(); + for ( ; it != itend; ++it) { old_items << it.value()->toHash(); } qDebug("Saving %d old items for feed %s", old_items.size(), displayName().toLocal8Bit().data()); @@ -175,7 +178,9 @@ uint RssFeed::count() const { } void RssFeed::markAsRead() { - for (RssArticleHash::ConstIterator it=m_articles.begin(); it != m_articles.end(); it++) { + RssArticleHash::ConstIterator it=m_articles.begin(); + RssArticleHash::ConstIterator itend=m_articles.end(); + for ( ; it != itend; ++it) { it.value()->markAsRead(); } m_manager->forwardFeedInfosChanged(m_url, displayName(), 0); @@ -183,7 +188,10 @@ void RssFeed::markAsRead() { uint RssFeed::unreadCount() const { uint nbUnread = 0; - for (RssArticleHash::ConstIterator it=m_articles.begin(); it != m_articles.end(); it++) { + + RssArticleHash::ConstIterator it=m_articles.begin(); + RssArticleHash::ConstIterator itend=m_articles.end(); + for ( ; it != itend; ++it) { if (!it.value()->isRead()) ++nbUnread; } @@ -196,7 +204,10 @@ RssArticleList RssFeed::articleList() const { RssArticleList RssFeed::unreadArticleList() const { RssArticleList unread_news; - for (RssArticleHash::ConstIterator it = m_articles.begin(); it != m_articles.end(); it++) { + + RssArticleHash::ConstIterator it = m_articles.begin(); + RssArticleHash::ConstIterator itend = m_articles.end(); + for ( ; it != itend; ++it) { if (!it.value()->isRead()) unread_news << it.value(); } @@ -296,7 +307,10 @@ bool RssFeed::parseRSS(QIODevice* device) void RssFeed::downloadMatchingArticleTorrents() { Q_ASSERT(RssSettings().isRssDownloadingEnabled()); RssDownloadRuleList *download_rules = m_manager->downloadRules(); - for (RssArticleHash::ConstIterator it = m_articles.begin(); it != m_articles.end(); it++) { + + RssArticleHash::ConstIterator it = m_articles.begin(); + RssArticleHash::ConstIterator itend = m_articles.end(); + for ( ; it != itend; ++it) { RssArticlePtr article = it.value(); // Skip read articles if (article->isRead()) diff --git a/src/rss/rssfolder.cpp b/src/rss/rssfolder.cpp index 6f094ff0a..b0bd6253d 100644 --- a/src/rss/rssfolder.cpp +++ b/src/rss/rssfolder.cpp @@ -44,7 +44,10 @@ RssFolder::~RssFolder() { unsigned int RssFolder::unreadCount() const { uint nb_unread = 0; - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { nb_unread += it.value()->unreadCount(); } return nb_unread; @@ -81,14 +84,19 @@ RssFeedPtr RssFolder::addStream(RssManager* manager, const QString &url) { // Refresh All Children void RssFolder::refresh() { - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { it.value()->refresh(); } } RssArticleList RssFolder::articleList() const { RssArticleList news; - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { news << it.value()->articleList(); } return news; @@ -96,7 +104,10 @@ RssArticleList RssFolder::articleList() const { RssArticleList RssFolder::unreadArticleList() const { RssArticleList unread_news; - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { unread_news << it.value()->unreadArticleList(); } return unread_news; @@ -108,7 +119,10 @@ RssFileList RssFolder::getContent() const { unsigned int RssFolder::getNbFeeds() const { uint nbFeeds = 0; - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { if (RssFolderPtr folder = qSharedPointerDynamicCast(it.value())) nbFeeds += folder->getNbFeeds(); else @@ -133,14 +147,19 @@ void RssFolder::rename(const QString &new_name) { } void RssFolder::markAsRead() { - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { it.value()->markAsRead(); } } RssFeedList RssFolder::getAllFeeds() const { RssFeedList streams; - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { if (RssFeedPtr feed = qSharedPointerDynamicCast(it.value())) { streams << feed; } else if (RssFolderPtr folder = qSharedPointerDynamicCast(it.value())) { @@ -152,7 +171,10 @@ RssFeedList RssFolder::getAllFeeds() const { QHash RssFolder::getAllFeedsAsHash() const { QHash ret; - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { if (RssFeedPtr feed = qSharedPointerDynamicCast(it.value())) { qDebug() << Q_FUNC_INFO << feed->url(); ret[feed->url()] = feed; @@ -182,7 +204,9 @@ void RssFolder::removeAllItems() { } void RssFolder::removeAllSettings() { - for (RssFileHash::ConstIterator it = m_children.begin(); it != m_children.end(); it++) { + RssFileHash::ConstIterator it = m_children.begin(); + RssFileHash::ConstIterator itend = m_children.end(); + for ( ; it != itend; ++it) { it.value()->removeAllSettings(); } }