mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 10:16:00 +03:00
Merge pull request #6319 from magao/pr6181_bugfix
Fix compilation error on Qt<5.4. Closes #6170.
This commit is contained in:
commit
52b1bb2ae4
1 changed files with 5 additions and 7 deletions
|
@ -31,8 +31,8 @@
|
|||
#include <QRegExp>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QStringRef>
|
||||
#include <QVector>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#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<QStringRef> range = ep.split('-');
|
||||
QStringList range = ep.split('-');
|
||||
Q_ASSERT(range.size() == 2);
|
||||
if (range.first().toInt() > range.last().toInt())
|
||||
continue; // Ignore this subrule completely
|
||||
|
|
Loading…
Reference in a new issue