2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +00:00

Replaced some qstr with u""_q literal.

This commit is contained in:
23rd
2022-11-27 00:20:17 +03:00
parent 22dc7023fc
commit 2acedca6b7
99 changed files with 477 additions and 480 deletions

View File

@@ -52,10 +52,10 @@ QMutex *_logsMutex(LogDataType type, bool clear = false) {
QString _logsFilePath(LogDataType type, const QString &postfix = QString()) {
QString path(cWorkingDir());
switch (type) {
case LogDataMain: path += qstr("log") + postfix + qstr(".txt"); break;
case LogDataDebug: path += qstr("DebugLogs/log") + postfix + qstr(".txt"); break;
case LogDataTcp: path += qstr("DebugLogs/tcp") + postfix + qstr(".txt"); break;
case LogDataMtp: path += qstr("DebugLogs/mtp") + postfix + qstr(".txt"); break;
case LogDataMain: path += u"log"_q + postfix + u".txt"_q; break;
case LogDataDebug: path += u"DebugLogs/log"_q + postfix + u".txt"_q; break;
case LogDataTcp: path += u"DebugLogs/tcp"_q + postfix + u".txt"_q; break;
case LogDataMtp: path += u"DebugLogs/mtp"_q + postfix + u".txt"_q; break;
}
return path;
}
@@ -165,8 +165,8 @@ private:
QDir working(cWorkingDir()); // delete all other log_startXX.txt that we can
QStringList oldlogs = working.entryList(QStringList("log_start*.txt"), QDir::Files);
for (QStringList::const_iterator i = oldlogs.cbegin(), e = oldlogs.cend(); i != e; ++i) {
QString oldlog = cWorkingDir() + *i, oldlogend = i->mid(qstr("log_start").size());
if (oldlogend.size() == 1 + qstr(".txt").size() && oldlogend.at(0).isDigit() && base::StringViewMid(oldlogend, 1) == qstr(".txt")) {
QString oldlog = cWorkingDir() + *i, oldlogend = i->mid(u"log_start"_q.size());
if (oldlogend.size() == 1 + u".txt"_q.size() && oldlogend.at(0).isDigit() && base::StringViewMid(oldlogend, 1) == u".txt"_q) {
bool removed = QFile(oldlog).remove();
LOG(("Old start log '%1' found, deleted: %2").arg(*i, Logs::b(removed)));
}
@@ -209,7 +209,7 @@ private:
files[type]->close();
}
} else {
QDir().mkdir(cWorkingDir() + qstr("DebugLogs"));
QDir().mkdir(cWorkingDir() + u"DebugLogs"_q);
}
}
if (files[type]->open(mode)) {
@@ -415,7 +415,7 @@ void start(not_null<Core::Launcher*> launcher) {
QDir().setCurrent(cWorkingDir());
#endif // !Q_OS_WINRT
QDir().mkpath(cWorkingDir() + qstr("tdata"));
QDir().mkpath(cWorkingDir() + u"tdata"_q);
launcher->workingFolderReady();
CrashReports::StartCatching(launcher);