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:
Chocobo1
2023-06-18 02:02:02 +08:00
parent f6b58f36e2
commit e6d85a468b
141 changed files with 3610 additions and 3604 deletions

View File

@@ -81,12 +81,12 @@ bool Utils::Fs::smartRemoveEmptyFolderTree(const Path &path)
const QStringList deleteFilesList =
{
// Windows
u"Thumbs.db"_qs,
u"desktop.ini"_qs,
u"Thumbs.db"_s,
u"desktop.ini"_s,
// Linux
u".directory"_qs,
u".directory"_s,
// Mac OS
u".DS_Store"_qs
u".DS_Store"_s
};
// travel from the deepest folder and remove anything unwanted on the way out.
@@ -191,7 +191,7 @@ bool Utils::Fs::sameFiles(const Path &path1, const Path &path2)
QString Utils::Fs::toValidFileName(const QString &name, const QString &pad)
{
const QRegularExpression regex {u"[\\\\/:?\"*<>|]+"_qs};
const QRegularExpression regex {u"[\\\\/:?\"*<>|]+"_s};
QString validName = name.trimmed();
validName.replace(regex, pad);
@@ -201,7 +201,7 @@ QString Utils::Fs::toValidFileName(const QString &name, const QString &pad)
Path Utils::Fs::toValidPath(const QString &name, const QString &pad)
{
const QRegularExpression regex {u"[:?\"*<>|]+"_qs};
const QRegularExpression regex {u"[:?\"*<>|]+"_s};
QString validPathStr = name;
validPathStr.replace(regex, pad);
@@ -216,7 +216,7 @@ qint64 Utils::Fs::freeDiskSpaceOnPath(const Path &path)
Path Utils::Fs::tempPath()
{
static const Path path = Path(QDir::tempPath()) / Path(u".qBittorrent"_qs);
static const Path path = Path(QDir::tempPath()) / Path(u".qBittorrent"_s);
mkdir(path);
return path;
}