mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 21:28:07 -06:00
Rename literal operator
Qt 6.4 introduced `QString operator""_s()` and the previous `""_qs` is deprecated since Qt 6.8.
This commit is contained in:
@@ -78,7 +78,7 @@ void DNSUpdater::checkPublicIP()
|
||||
Q_ASSERT(m_state == OK);
|
||||
|
||||
DownloadManager::instance()->download(
|
||||
DownloadRequest(u"http://checkip.dyndns.org"_qs).userAgent(QStringLiteral("qBittorrent/" QBT_VERSION_2))
|
||||
DownloadRequest(u"http://checkip.dyndns.org"_s).userAgent(QStringLiteral("qBittorrent/" QBT_VERSION_2))
|
||||
, Preferences::instance()->useProxyForGeneralPurposes(), this, &DNSUpdater::ipRequestFinished);
|
||||
|
||||
m_lastIPCheckTime = QDateTime::currentDateTime();
|
||||
@@ -93,7 +93,7 @@ void DNSUpdater::ipRequestFinished(const DownloadResult &result)
|
||||
}
|
||||
|
||||
// Parse response
|
||||
const QRegularExpressionMatch ipRegexMatch = QRegularExpression(u"Current IP Address:\\s+([^<]+)</body>"_qs).match(QString::fromUtf8(result.data));
|
||||
const QRegularExpressionMatch ipRegexMatch = QRegularExpression(u"Current IP Address:\\s+([^<]+)</body>"_s).match(QString::fromUtf8(result.data));
|
||||
if (ipRegexMatch.hasMatch())
|
||||
{
|
||||
QString ipStr = ipRegexMatch.captured(1);
|
||||
@@ -134,9 +134,9 @@ QString DNSUpdater::getUpdateUrl() const
|
||||
{
|
||||
QUrl url;
|
||||
#ifdef QT_NO_OPENSSL
|
||||
url.setScheme(u"http"_qs);
|
||||
url.setScheme(u"http"_s);
|
||||
#else
|
||||
url.setScheme(u"https"_qs);
|
||||
url.setScheme(u"https"_s);
|
||||
#endif
|
||||
url.setUserName(m_username);
|
||||
url.setPassword(m_password);
|
||||
@@ -146,21 +146,21 @@ QString DNSUpdater::getUpdateUrl() const
|
||||
switch (m_service)
|
||||
{
|
||||
case DNS::Service::DynDNS:
|
||||
url.setHost(u"members.dyndns.org"_qs);
|
||||
url.setHost(u"members.dyndns.org"_s);
|
||||
break;
|
||||
case DNS::Service::NoIP:
|
||||
url.setHost(u"dynupdate.no-ip.com"_qs);
|
||||
url.setHost(u"dynupdate.no-ip.com"_s);
|
||||
break;
|
||||
default:
|
||||
qWarning() << "Unrecognized Dynamic DNS service!";
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
url.setPath(u"/nic/update"_qs);
|
||||
url.setPath(u"/nic/update"_s);
|
||||
|
||||
QUrlQuery urlQuery(url);
|
||||
urlQuery.addQueryItem(u"hostname"_qs, m_domain);
|
||||
urlQuery.addQueryItem(u"myip"_qs, m_lastIP.toString());
|
||||
urlQuery.addQueryItem(u"hostname"_s, m_domain);
|
||||
urlQuery.addQueryItem(u"myip"_s, m_lastIP.toString());
|
||||
url.setQuery(urlQuery);
|
||||
Q_ASSERT(url.isValid());
|
||||
|
||||
@@ -223,7 +223,7 @@ void DNSUpdater::processIPUpdateReply(const QString &reply)
|
||||
|
||||
if (code == u"!donator")
|
||||
{
|
||||
LogMsg(tr("Dynamic DNS error: %1 was returned by the service, please submit a bug report at https://bugs.qbittorrent.org.").arg(u"!donator"_qs),
|
||||
LogMsg(tr("Dynamic DNS error: %1 was returned by the service, please submit a bug report at https://bugs.qbittorrent.org.").arg(u"!donator"_s),
|
||||
Log::CRITICAL);
|
||||
m_state = FATAL;
|
||||
return;
|
||||
@@ -250,7 +250,7 @@ void DNSUpdater::updateCredentials()
|
||||
if (m_domain != pref->getDynDomainName())
|
||||
{
|
||||
m_domain = pref->getDynDomainName();
|
||||
const QRegularExpressionMatch domainRegexMatch = QRegularExpression(u"^(?:(?!\\d|-)[a-zA-Z0-9\\-]{1,63}\\.)+[a-zA-Z]{2,}$"_qs).match(m_domain);
|
||||
const QRegularExpressionMatch domainRegexMatch = QRegularExpression(u"^(?:(?!\\d|-)[a-zA-Z0-9\\-]{1,63}\\.)+[a-zA-Z]{2,}$"_s).match(m_domain);
|
||||
if (!domainRegexMatch.hasMatch())
|
||||
{
|
||||
LogMsg(tr("Dynamic DNS error: supplied domain name is invalid."), Log::CRITICAL);
|
||||
@@ -301,9 +301,9 @@ QUrl DNSUpdater::getRegistrationUrl(const DNS::Service service)
|
||||
switch (service)
|
||||
{
|
||||
case DNS::Service::DynDNS:
|
||||
return {u"https://account.dyn.com/entrance/"_qs};
|
||||
return {u"https://account.dyn.com/entrance/"_s};
|
||||
case DNS::Service::NoIP:
|
||||
return {u"https://www.noip.com/remote-access"_qs};
|
||||
return {u"https://www.noip.com/remote-access"_s};
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user