Browse Source

Merge pull request #8471 from luis-pereira/use-qstring-ref

Don't create temporary substrings
adaptive-webui-19844
Vladimir Golovnev 7 years ago committed by GitHub
parent
commit
7cb6100c9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/app/application.cpp
  2. 2
      src/base/rss/rss_autodownloadrule.cpp

4
src/app/application.cpp

@ -401,7 +401,7 @@ void Application::processParams(const QStringList &params) @@ -401,7 +401,7 @@ void Application::processParams(const QStringList &params)
}
if (param.startsWith(QLatin1String("@addPaused="))) {
torrentParams.addPaused = param.mid(11).toInt() ? TriStateBool::True : TriStateBool::False;
torrentParams.addPaused = param.midRef(11).toInt() ? TriStateBool::True : TriStateBool::False;
continue;
}
@ -426,7 +426,7 @@ void Application::processParams(const QStringList &params) @@ -426,7 +426,7 @@ void Application::processParams(const QStringList &params)
}
if (param.startsWith(QLatin1String("@skipDialog="))) {
skipTorrentDialog = param.mid(12).toInt() ? TriStateBool::True : TriStateBool::False;
skipTorrentDialog = param.midRef(12).toInt() ? TriStateBool::True : TriStateBool::False;
continue;
}

2
src/base/rss/rss_autodownloadrule.cpp

@ -302,7 +302,7 @@ bool AutoDownloadRule::matches(const QString &articleTitle) const @@ -302,7 +302,7 @@ bool AutoDownloadRule::matches(const QString &articleTitle) const
QRegularExpression reg(cachedRegex(partialPattern1));
if (ep.endsWith('-')) { // Infinite range
int epOurs = ep.left(ep.size() - 1).toInt();
int epOurs = ep.leftRef(ep.size() - 1).toInt();
// Extract partial match from article and compare as digits
matcher = reg.match(articleTitle);

Loading…
Cancel
Save