From 5d185f1fcd804f70133626d7772b6c1882f49312 Mon Sep 17 00:00:00 2001 From: Tim Delaney Date: Fri, 27 Jan 2017 14:24:51 +1100 Subject: [PATCH] Fix compilation error on Qt<5.4. Closes #6170. --HG-- branch : magao-dev --- src/base/rss/rssdownloadrule.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/base/rss/rssdownloadrule.cpp b/src/base/rss/rssdownloadrule.cpp index be1eb0d3f..beb861117 100644 --- a/src/base/rss/rssdownloadrule.cpp +++ b/src/base/rss/rssdownloadrule.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include "base/preferences.h" #include "base/utils/fs.h" @@ -155,12 +155,10 @@ bool DownloadRule::matches(const QString &articleTitle) const QStringList eps = f.cap(2).split(";"); int sOurs = s.toInt(); - foreach (const QString &epStr, eps) { - if (epStr.isEmpty()) + foreach (QString ep, eps) { + if (ep.isEmpty()) continue; - QStringRef ep( &epStr); - // We need to trim leading zeroes, but if it's all zeros then we want episode zero. while (ep.size() > 1 && ep.startsWith("0")) ep = ep.right(ep.size() - 1); @@ -192,7 +190,7 @@ bool DownloadRule::matches(const QString &articleTitle) const } } else { // Normal range - QVector range = ep.split('-'); + QStringList range = ep.split('-'); Q_ASSERT(range.size() == 2); if (range.first().toInt() > range.last().toInt()) continue; // Ignore this subrule completely