Use QString literals

It covers src/webui and enables `QT_NO_CAST_FROM_ASCII`.
This commit is contained in:
Chocobo1 2022-03-19 15:57:41 +08:00
parent f888fb4ac7
commit efc04645b7
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
25 changed files with 836 additions and 824 deletions

View file

@ -43,6 +43,7 @@
#include <QSysInfo>
#endif
#include "base/global.h"
#include "base/net/downloadmanager.h"
#include "base/utils/version.h"
#include "base/version.h"
@ -79,7 +80,7 @@ void ProgramUpdater::checkForUpdates() const
// Don't change this User-Agent. In case our updater goes haywire,
// the filehost can identify it and contact us.
Net::DownloadManager::instance()->download(
Net::DownloadRequest(RSS_URL).userAgent("qBittorrent/" QBT_VERSION_2 " ProgramUpdater (www.qbittorrent.org)")
Net::DownloadRequest(RSS_URL).userAgent(QStringLiteral("qBittorrent/" QBT_VERSION_2 " ProgramUpdater (www.qbittorrent.org)"))
, this, &ProgramUpdater::rssDownloadFinished);
}
@ -108,11 +109,11 @@ void ProgramUpdater::rssDownloadFinished(const Net::DownloadResult &result)
};
#ifdef Q_OS_MACOS
const QString OS_TYPE {"Mac OS X"};
const QString OS_TYPE = u"Mac OS X"_qs;
#elif defined(Q_OS_WIN)
const QString OS_TYPE {(::IsWindows7OrGreater()
&& QSysInfo::currentCpuArchitecture().endsWith("64"))
? "Windows x64" : "Windows"};
const QString OS_TYPE = (::IsWindows7OrGreater() && QSysInfo::currentCpuArchitecture().endsWith(u"64"))
? u"Windows x64"_qs
: u"Windows"_qs;
#endif
bool inItem = false;