Use QString literals

The plan is to define `QT_NO_CAST_FROM_ASCII` eventually.
PR #16561.
This commit is contained in:
Chocobo1
2022-03-04 13:25:22 +08:00
committed by GitHub
parent 2c8447853b
commit ab64ee872b
23 changed files with 104 additions and 108 deletions

View File

@@ -31,6 +31,7 @@
#include <QCoreApplication>
#include "base/global.h"
#include "base/utils/fs.h"
Private::Profile::Profile(const QString &configurationName)
@@ -91,7 +92,7 @@ Path Private::DefaultProfile::dataLocation() const
// On Linux keep using the legacy directory ~/.local/share/data/ if it exists
const Path genericDataPath {QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)};
const Path profilePath {profileName()};
const Path legacyDir = genericDataPath / Path("data") / profilePath;
const Path legacyDir = genericDataPath / Path(u"data"_qs) / profilePath;
const Path dataDir = genericDataPath / profilePath;
@@ -130,10 +131,10 @@ Private::CustomProfile::CustomProfile(const Path &rootPath, const QString &confi
: Profile {configurationName}
, m_rootPath {rootPath}
, m_basePath {m_rootPath / Path(profileName())}
, m_cacheLocation {m_basePath / Path("cache")}
, m_configLocation {m_basePath / Path("config")}
, m_dataLocation {m_basePath / Path("data")}
, m_downloadLocation {m_basePath / Path("downloads")}
, m_cacheLocation {m_basePath / Path(u"cache"_qs)}
, m_configLocation {m_basePath / Path(u"config"_qs)}
, m_dataLocation {m_basePath / Path(u"data"_qs)}
, m_downloadLocation {m_basePath / Path(u"downloads"_qs)}
{
}