mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 22:33:34 -07:00
Apply suggestions from code review
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
This commit is contained in:
parent
3c37670592
commit
9ca45e0827
1 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ namespace
|
||||||
const QRegularExpression rx {uR"(((<a\s+[^>]*?href|<img\s+[^>]*?src)\s*=\s*["'])((https?|ftp):)?(\/\/[^\/]*)?(\/?[^\/"].*?)(["']))"_s
|
const QRegularExpression rx {uR"(((<a\s+[^>]*?href|<img\s+[^>]*?src)\s*=\s*["'])((https?|ftp):)?(\/\/[^\/]*)?(\/?[^\/"].*?)(["']))"_s
|
||||||
, QRegularExpression::CaseInsensitiveOption};
|
, QRegularExpression::CaseInsensitiveOption};
|
||||||
|
|
||||||
const QString normalizedBaseUrl = baseUrl.endsWith(u'/') ? baseUrl : baseUrl + u'/';
|
const QString normalizedBaseUrl = baseUrl.endsWith(u'/') ? baseUrl : (baseUrl + u'/');
|
||||||
const QUrl url {normalizedBaseUrl};
|
const QUrl url {normalizedBaseUrl};
|
||||||
const QString defaultScheme = url.scheme();
|
const QString defaultScheme = url.scheme();
|
||||||
QRegularExpressionMatchIterator iter = rx.globalMatch(html);
|
QRegularExpressionMatchIterator iter = rx.globalMatch(html);
|
||||||
|
@ -87,7 +87,7 @@ namespace
|
||||||
relativePath = relativePath.mid(1);
|
relativePath = relativePath.mid(1);
|
||||||
|
|
||||||
const QString absoluteUrl = !host.isEmpty()
|
const QString absoluteUrl = !host.isEmpty()
|
||||||
? QString(defaultScheme + u":" + host) : QString(normalizedBaseUrl + relativePath);
|
? QString(defaultScheme + u':' + host) : (normalizedBaseUrl + relativePath);
|
||||||
const QString fullMatch = match.captured(0);
|
const QString fullMatch = match.captured(0);
|
||||||
const QString prefix = match.captured(1);
|
const QString prefix = match.captured(1);
|
||||||
const QString suffix = match.captured(7);
|
const QString suffix = match.captured(7);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue