mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
@@ -104,10 +104,10 @@ namespace
|
||||
#define SETTINGS_KEY(name) "Application/" name
|
||||
#define FILELOGGER_SETTINGS_KEY(name) (SETTINGS_KEY("FileLogger/") name)
|
||||
|
||||
const QString LOG_FOLDER = QStringLiteral("logs");
|
||||
const QChar PARAMS_SEPARATOR = QLatin1Char('|');
|
||||
const QString LOG_FOLDER = u"logs"_qs;
|
||||
const QChar PARAMS_SEPARATOR = u'|';
|
||||
|
||||
const Path DEFAULT_PORTABLE_MODE_PROFILE_DIR {QStringLiteral("profile")};
|
||||
const Path DEFAULT_PORTABLE_MODE_PROFILE_DIR {u"profile"_qs};
|
||||
|
||||
const int MIN_FILELOG_SIZE = 1024; // 1KiB
|
||||
const int MAX_FILELOG_SIZE = 1000 * 1024 * 1024; // 1000MiB
|
||||
@@ -337,7 +337,7 @@ void Application::runExternalProgram(const BitTorrent::Torrent *torrent) const
|
||||
|
||||
for (int i = (program.length() - 2); i >= 0; --i)
|
||||
{
|
||||
if (program[i] != QLatin1Char('%'))
|
||||
if (program[i] != u'%')
|
||||
continue;
|
||||
|
||||
const ushort specifier = program[i + 1].unicode();
|
||||
@@ -361,13 +361,13 @@ void Application::runExternalProgram(const BitTorrent::Torrent *torrent) const
|
||||
#endif
|
||||
break;
|
||||
case u'G':
|
||||
program.replace(i, 2, torrent->tags().join(QLatin1String(",")));
|
||||
program.replace(i, 2, torrent->tags().join(u","_qs));
|
||||
break;
|
||||
case u'I':
|
||||
program.replace(i, 2, (torrent->infoHash().v1().isValid() ? torrent->infoHash().v1().toString() : QLatin1String("-")));
|
||||
program.replace(i, 2, (torrent->infoHash().v1().isValid() ? torrent->infoHash().v1().toString() : u"-"_qs));
|
||||
break;
|
||||
case u'J':
|
||||
program.replace(i, 2, (torrent->infoHash().v2().isValid() ? torrent->infoHash().v2().toString() : QLatin1String("-")));
|
||||
program.replace(i, 2, (torrent->infoHash().v2().isValid() ? torrent->infoHash().v2().toString() : u"-"_qs));
|
||||
break;
|
||||
case u'K':
|
||||
program.replace(i, 2, torrent->id().toString());
|
||||
@@ -563,43 +563,43 @@ void Application::processParams(const QStringList ¶ms)
|
||||
|
||||
// Process strings indicating options specified by the user.
|
||||
|
||||
if (param.startsWith(QLatin1String("@savePath=")))
|
||||
if (param.startsWith(u"@savePath="))
|
||||
{
|
||||
torrentParams.savePath = Path(param.mid(10));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param.startsWith(QLatin1String("@addPaused=")))
|
||||
if (param.startsWith(u"@addPaused="))
|
||||
{
|
||||
torrentParams.addPaused = (QStringView(param).mid(11).toInt() != 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param == QLatin1String("@skipChecking"))
|
||||
if (param == u"@skipChecking")
|
||||
{
|
||||
torrentParams.skipChecking = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param.startsWith(QLatin1String("@category=")))
|
||||
if (param.startsWith(u"@category="))
|
||||
{
|
||||
torrentParams.category = param.mid(10);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param == QLatin1String("@sequential"))
|
||||
if (param == u"@sequential")
|
||||
{
|
||||
torrentParams.sequential = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param == QLatin1String("@firstLastPiecePriority"))
|
||||
if (param == u"@firstLastPiecePriority")
|
||||
{
|
||||
torrentParams.firstLastPiecePriority = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param.startsWith(QLatin1String("@skipDialog=")))
|
||||
if (param.startsWith(u"@skipDialog="))
|
||||
{
|
||||
skipTorrentDialog = (QStringView(param).mid(12).toInt() != 0);
|
||||
continue;
|
||||
@@ -671,9 +671,9 @@ int Application::exec(const QStringList ¶ms)
|
||||
#ifndef DISABLE_WEBUI
|
||||
const Preferences *pref = Preferences::instance();
|
||||
|
||||
const auto scheme = QString::fromLatin1(pref->isWebUiHttpsEnabled() ? "https" : "http");
|
||||
const auto url = QString::fromLatin1("%1://localhost:%2\n").arg(scheme, QString::number(pref->getWebUiPort()));
|
||||
const QString mesg = QString::fromLatin1("\n******** %1 ********\n").arg(tr("Information"))
|
||||
const auto scheme = pref->isWebUiHttpsEnabled() ? u"https"_qs : u"http"_qs;
|
||||
const auto url = u"%1://localhost:%2\n"_qs.arg(scheme, QString::number(pref->getWebUiPort()));
|
||||
const QString mesg = u"\n******** %1 ********\n"_qs.arg(tr("Information"))
|
||||
+ tr("To control qBittorrent, access the WebUI at: %1").arg(url);
|
||||
printf("%s\n", qUtf8Printable(mesg));
|
||||
|
||||
@@ -740,15 +740,15 @@ void Application::initializeTranslation()
|
||||
// Load translation
|
||||
const QString localeStr = pref->getLocale();
|
||||
|
||||
if (m_qtTranslator.load(QLatin1String("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ||
|
||||
m_qtTranslator.load(QLatin1String("qt_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
if (m_qtTranslator.load((u"qtbase_" + localeStr), QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ||
|
||||
m_qtTranslator.load((u"qt_" + localeStr), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
qDebug("Qt %s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("Qt %s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
|
||||
installTranslator(&m_qtTranslator);
|
||||
|
||||
if (m_translator.load(QLatin1String(":/lang/qbittorrent_") + localeStr))
|
||||
if (m_translator.load(u":/lang/qbittorrent_" + localeStr))
|
||||
qDebug("%s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
|
||||
@@ -48,7 +48,7 @@ ApplicationInstanceManager::ApplicationInstanceManager(const Path &instancePath,
|
||||
connect(m_peer, &QtLocalPeer::messageReceived, this, &ApplicationInstanceManager::messageReceived);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
const QString sharedMemoryKey = instancePath.data() + QLatin1String("/shared-memory");
|
||||
const QString sharedMemoryKey = instancePath.data() + u"/shared-memory";
|
||||
auto sharedMem = new QSharedMemory(sharedMemoryKey, this);
|
||||
if (m_isFirstInstance)
|
||||
{
|
||||
|
||||
@@ -67,12 +67,12 @@ namespace
|
||||
|
||||
QString fullParameter() const
|
||||
{
|
||||
return QLatin1String("--") + QLatin1String(m_name);
|
||||
return u"--" + QString::fromLatin1(m_name);
|
||||
}
|
||||
|
||||
QString shortcutParameter() const
|
||||
{
|
||||
return QLatin1String("-") + QLatin1Char(m_shortcut);
|
||||
return u"-" + QChar::fromLatin1(m_shortcut);
|
||||
}
|
||||
|
||||
bool hasShortcut() const
|
||||
@@ -82,8 +82,8 @@ namespace
|
||||
|
||||
QString envVarName() const
|
||||
{
|
||||
return QLatin1String("QBT_")
|
||||
+ QString::fromLatin1(m_name).toUpper().replace(QLatin1Char('-'), QLatin1Char('_'));
|
||||
return u"QBT_"
|
||||
+ QString::fromLatin1(m_name).toUpper().replace(u'-', u'_');
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -121,14 +121,14 @@ namespace
|
||||
{
|
||||
QString val = env.value(envVarName());
|
||||
// we accept "1" and "true" (upper or lower cased) as boolean 'true' values
|
||||
return ((val == QLatin1String("1")) || (val.toUpper() == QLatin1String("TRUE")));
|
||||
return ((val == u"1") || (val.toUpper() == u"TRUE"));
|
||||
}
|
||||
|
||||
QString usage() const
|
||||
{
|
||||
QString res;
|
||||
if (hasShortcut())
|
||||
res += shortcutParameter() + QLatin1String(" | ");
|
||||
res += shortcutParameter() + u" | ";
|
||||
res += fullParameter();
|
||||
return padUsageText(res);
|
||||
}
|
||||
@@ -155,29 +155,29 @@ namespace
|
||||
|
||||
QString value(const QString &arg) const
|
||||
{
|
||||
QStringList parts = arg.split(QLatin1Char('='));
|
||||
QStringList parts = arg.split(u'=');
|
||||
if (parts.size() == 2)
|
||||
return Utils::String::unquote(parts[1], QLatin1String("'\""));
|
||||
return Utils::String::unquote(parts[1], u"'\""_qs);
|
||||
throw CommandLineParameterError(QObject::tr("Parameter '%1' must follow syntax '%1=%2'",
|
||||
"e.g. Parameter '--webui-port' must follow syntax '--webui-port=value'")
|
||||
.arg(fullParameter(), QLatin1String("<value>")));
|
||||
.arg(fullParameter(), u"<value>"_qs));
|
||||
}
|
||||
|
||||
QString value(const QProcessEnvironment &env, const QString &defaultValue = {}) const
|
||||
{
|
||||
QString val = env.value(envVarName());
|
||||
return val.isEmpty() ? defaultValue : Utils::String::unquote(val, QLatin1String("'\""));
|
||||
return val.isEmpty() ? defaultValue : Utils::String::unquote(val, u"'\""_qs);
|
||||
}
|
||||
|
||||
QString usage(const QString &valueName) const
|
||||
{
|
||||
return padUsageText(parameterAssignment() + QLatin1Char('<') + valueName + QLatin1Char('>'));
|
||||
return padUsageText(parameterAssignment() + u'<' + valueName + u'>');
|
||||
}
|
||||
|
||||
private:
|
||||
QString parameterAssignment() const
|
||||
{
|
||||
return fullParameter() + QLatin1Char('=');
|
||||
return fullParameter() + u'=';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace
|
||||
if (!ok)
|
||||
throw CommandLineParameterError(QObject::tr("Parameter '%1' must follow syntax '%1=%2'",
|
||||
"e.g. Parameter '--webui-port' must follow syntax '--webui-port=<value>'")
|
||||
.arg(fullParameter(), QLatin1String("<integer value>")));
|
||||
.arg(fullParameter(), u"<integer value>"_qs));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -245,18 +245,18 @@ namespace
|
||||
|
||||
bool operator==(const QString &arg) const
|
||||
{
|
||||
QStringList parts = arg.split(QLatin1Char('='));
|
||||
QStringList parts = arg.split(u'=');
|
||||
return parts[0] == fullParameter();
|
||||
}
|
||||
|
||||
QString usage() const
|
||||
{
|
||||
return padUsageText(fullParameter() + QLatin1String("=<true|false>"));
|
||||
return padUsageText(fullParameter() + u"=<true|false>");
|
||||
}
|
||||
|
||||
std::optional<bool> value(const QString &arg) const
|
||||
{
|
||||
QStringList parts = arg.split(QLatin1Char('='));
|
||||
QStringList parts = arg.split(u'=');
|
||||
|
||||
if (parts.size() == 1)
|
||||
{
|
||||
@@ -266,11 +266,11 @@ namespace
|
||||
{
|
||||
QString val = parts[1];
|
||||
|
||||
if ((val.toUpper() == QLatin1String("TRUE")) || (val == QLatin1String("1")))
|
||||
if ((val.toUpper() == u"TRUE") || (val == u"1"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((val.toUpper() == QLatin1String("FALSE")) || (val == QLatin1String("0")))
|
||||
if ((val.toUpper() == u"FALSE") || (val == u"0"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -279,7 +279,7 @@ namespace
|
||||
throw CommandLineParameterError(QObject::tr("Parameter '%1' must follow syntax '%1=%2'",
|
||||
"e.g. Parameter '--add-paused' must follow syntax "
|
||||
"'--add-paused=<true|false>'")
|
||||
.arg(fullParameter(), QLatin1String("<true|false>")));
|
||||
.arg(fullParameter(), u"<true|false>"_qs));
|
||||
}
|
||||
|
||||
std::optional<bool> value(const QProcessEnvironment &env) const
|
||||
@@ -290,21 +290,21 @@ namespace
|
||||
{
|
||||
return m_defaultValue;
|
||||
}
|
||||
if (val == QLatin1String("-1"))
|
||||
if (val == u"-1")
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
if ((val.toUpper() == QLatin1String("TRUE")) || (val == QLatin1String("1")))
|
||||
if ((val.toUpper() == u"TRUE") || (val == u"1"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((val.toUpper() == QLatin1String("FALSE")) || (val == QLatin1String("0")))
|
||||
if ((val.toUpper() == u"FALSE") || (val == u"0"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
qDebug() << QObject::tr("Expected %1 in environment variable '%2', but got '%3'")
|
||||
.arg(QLatin1String("true|false"), envVarName(), val);
|
||||
.arg(u"true|false"_qs, envVarName(), val);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@@ -372,25 +372,25 @@ QStringList QBtCommandLineParameters::paramList() const
|
||||
// torrent paths or URLs.
|
||||
|
||||
if (!savePath.isEmpty())
|
||||
result.append(QLatin1String("@savePath=") + savePath.data());
|
||||
result.append(u"@savePath=" + savePath.data());
|
||||
|
||||
if (addPaused.has_value())
|
||||
result.append(*addPaused ? QLatin1String {"@addPaused=1"} : QLatin1String {"@addPaused=0"});
|
||||
result.append(*addPaused ? u"@addPaused=1"_qs : u"@addPaused=0"_qs);
|
||||
|
||||
if (skipChecking)
|
||||
result.append(QLatin1String("@skipChecking"));
|
||||
result.append(u"@skipChecking"_qs);
|
||||
|
||||
if (!category.isEmpty())
|
||||
result.append(QLatin1String("@category=") + category);
|
||||
result.append(u"@category=" + category);
|
||||
|
||||
if (sequential)
|
||||
result.append(QLatin1String("@sequential"));
|
||||
result.append(u"@sequential"_qs);
|
||||
|
||||
if (firstLastPiecePriority)
|
||||
result.append(QLatin1String("@firstLastPiecePriority"));
|
||||
result.append(u"@firstLastPiecePriority"_qs);
|
||||
|
||||
if (skipDialog.has_value())
|
||||
result.append(*skipDialog ? QLatin1String {"@skipDialog=1"} : QLatin1String {"@skipDialog=0"});
|
||||
result.append(*skipDialog ? u"@skipDialog=1"_qs : u"@skipDialog=0"_qs);
|
||||
|
||||
result += torrents;
|
||||
return result;
|
||||
@@ -423,7 +423,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
|
||||
result.webUiPort = WEBUI_PORT_OPTION.value(arg);
|
||||
if ((result.webUiPort < 1) || (result.webUiPort > 65535))
|
||||
throw CommandLineParameterError(QObject::tr("%1 must specify a valid port (1 to 65535).")
|
||||
.arg(QLatin1String("--webui-port")));
|
||||
.arg(u"--webui-port"_qs));
|
||||
}
|
||||
#ifndef DISABLE_GUI
|
||||
else if (arg == NO_SPLASH_OPTION)
|
||||
@@ -527,7 +527,7 @@ QString makeUsage(const QString &prgName)
|
||||
QString indentation = QString(USAGE_INDENTATION, u' ');
|
||||
|
||||
stream << QObject::tr("Usage:") << '\n'
|
||||
<< indentation << prgName << QLatin1String(" [options] [(<filename> | <url>)...]") << '\n'
|
||||
<< indentation << prgName << u" [options] [(<filename> | <url>)...]"_qs << '\n'
|
||||
|
||||
<< QObject::tr("Options:") << '\n'
|
||||
#if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
|
||||
@@ -573,7 +573,7 @@ QString makeUsage(const QString &prgName)
|
||||
"'parameter-name', environment variable name is 'QBT_PARAMETER_NAME' (in upper "
|
||||
"case, '-' replaced with '_'). To pass flag values, set the variable to '1' or "
|
||||
"'TRUE'. For example, to disable the splash screen: "), 0) << "\n"
|
||||
<< QLatin1String("QBT_NO_SPLASH=1 ") << prgName << '\n'
|
||||
<< u"QBT_NO_SPLASH=1 "_qs << prgName << '\n'
|
||||
<< wrapText(QObject::tr("Command line parameters take precedence over environment variables"), 0) << '\n';
|
||||
|
||||
return text;
|
||||
|
||||
@@ -165,7 +165,7 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
throw CommandLineParameterError(QObject::tr("%1 must be the single command line parameter.")
|
||||
.arg(QLatin1String("-v (or --version)")));
|
||||
.arg(u"-v (or --version)"_qs));
|
||||
}
|
||||
#endif
|
||||
if (params.showHelp)
|
||||
@@ -176,7 +176,7 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
throw CommandLineParameterError(QObject::tr("%1 must be the single command line parameter.")
|
||||
.arg(QLatin1String("-h (or --help)")));
|
||||
.arg(u"-h (or --help)"_qs));
|
||||
}
|
||||
|
||||
const bool firstTimeUser = !Preferences::instance()->getAcceptedLegal();
|
||||
@@ -208,7 +208,7 @@ int main(int argc, char *argv[])
|
||||
if (params.shouldDaemonize)
|
||||
{
|
||||
throw CommandLineParameterError(QObject::tr("You cannot use %1: qBittorrent is already running for this user.")
|
||||
.arg(QLatin1String("-d (or --daemon)")));
|
||||
.arg(u"-d (or --daemon)"_qs));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -362,7 +362,7 @@ void sigAbnormalHandler(int signum)
|
||||
|
||||
#if defined Q_OS_WIN && !defined DISABLE_GUI
|
||||
StacktraceDialog dlg; // unsafe
|
||||
dlg.setStacktraceString(QLatin1String(sigName), straceWin::getBacktrace());
|
||||
dlg.setStacktraceString(QString::fromLatin1(sigName), straceWin::getBacktrace());
|
||||
dlg.exec();
|
||||
#endif
|
||||
|
||||
@@ -397,7 +397,7 @@ void displayBadArgMessage(const QString &message)
|
||||
const QString help = QObject::tr("Run application with -h option to read about command line parameters.");
|
||||
#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
|
||||
QMessageBox msgBox(QMessageBox::Critical, QObject::tr("Bad command line"),
|
||||
message + QLatin1Char('\n') + help, QMessageBox::Ok);
|
||||
(message + u'\n' + help), QMessageBox::Ok);
|
||||
msgBox.show(); // Need to be shown or to moveToCenter does not work
|
||||
msgBox.move(Utils::Gui::screenCenter(&msgBox));
|
||||
msgBox.exec();
|
||||
@@ -415,7 +415,7 @@ bool userAgreesWithLegalNotice()
|
||||
Q_ASSERT(!pref->getAcceptedLegal());
|
||||
|
||||
#ifdef DISABLE_GUI
|
||||
const QString eula = QString::fromLatin1("\n*** %1 ***\n").arg(QObject::tr("Legal Notice"))
|
||||
const QString eula = u"\n*** %1 ***\n"_qs.arg(QObject::tr("Legal Notice"))
|
||||
+ QObject::tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.") + u"\n\n"
|
||||
+ QObject::tr("No further notices will be issued.") + u"\n\n"
|
||||
+ QObject::tr("Press %1 key to accept and continue...").arg(u"'y'"_qs) + u'\n';
|
||||
|
||||
@@ -94,12 +94,12 @@ const char ACK[] = "ack";
|
||||
|
||||
QtLocalPeer::QtLocalPeer(const QString &path, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_socketName(path + QLatin1String("/ipc-socket"))
|
||||
, m_socketName(path + u"/ipc-socket")
|
||||
, m_server(new QLocalServer(this))
|
||||
{
|
||||
m_server->setSocketOptions(QLocalServer::UserAccessOption);
|
||||
|
||||
m_lockFile.setFileName(path + QLatin1String("/lockfile"));
|
||||
m_lockFile.setFileName(path + u"/lockfile");
|
||||
m_lockFile.open(QIODevice::ReadWrite);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(const int idx, const bool doCreate)
|
||||
if (m_mutexName.isEmpty())
|
||||
{
|
||||
QFileInfo fi(*this);
|
||||
m_mutexName = QString::fromLatin1("QtLockedFile mutex ") + fi.absoluteFilePath().toLower();
|
||||
m_mutexName = u"QtLockedFile mutex " + fi.absoluteFilePath().toLower();
|
||||
}
|
||||
|
||||
QString mname = m_mutexName;
|
||||
|
||||
@@ -97,8 +97,8 @@ BOOL CALLBACK straceWin::EnumModulesCB(LPCSTR ModuleName, DWORD64 BaseOfDll, PVO
|
||||
mod.SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
|
||||
if(SymGetModuleInfo64(context->hProcess, BaseOfDll, &mod))
|
||||
{
|
||||
QString moduleBase = QString::fromLatin1("0x%1").arg(BaseOfDll, 16, 16, QLatin1Char('0'));
|
||||
QString line = QString::fromLatin1("%1 %2 Image: %3")
|
||||
QString moduleBase = u"0x%1"_qs.arg(BaseOfDll, 16, 16, QChar(u'0'));
|
||||
QString line = u"%1 %2 Image: %3"_qs
|
||||
.arg(QString::fromUtf8(mod.ModuleName), -25)
|
||||
.arg(moduleBase, -13)
|
||||
.arg(QString::fromUtf8(mod.LoadedImageName));
|
||||
@@ -107,7 +107,7 @@ BOOL CALLBACK straceWin::EnumModulesCB(LPCSTR ModuleName, DWORD64 BaseOfDll, PVO
|
||||
const auto pdbName = QString::fromUtf8(mod.LoadedPdbName);
|
||||
if(!pdbName.isEmpty())
|
||||
{
|
||||
QString line2 = QString::fromLatin1("%1 %2")
|
||||
QString line2 = u"%1 %2"_qs
|
||||
.arg(u""_qs, 35)
|
||||
.arg(pdbName);
|
||||
context->stream << line2 << '\n';
|
||||
@@ -173,7 +173,7 @@ QString straceWin::getSourcePathAndLineNumber(HANDLE hProcess, DWORD64 addr)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return QString::fromLatin1("%1 : %2").arg(path).arg(line.LineNumber);
|
||||
return u"%1 : %2"_qs.arg(path).arg(line.LineNumber);
|
||||
}
|
||||
|
||||
return QString();
|
||||
@@ -311,7 +311,7 @@ const QString straceWin::getBacktrace()
|
||||
}
|
||||
else
|
||||
{
|
||||
funcName = QString::fromLatin1("0x%1").arg(ihsf.InstructionOffset, 8, 16, QLatin1Char('0'));
|
||||
funcName = u"0x%1"_qs.arg(ihsf.InstructionOffset, 8, 16, QChar(u'0'));
|
||||
}
|
||||
SymSetContext(hProcess, &ihsf, NULL);
|
||||
#ifndef __MINGW32__
|
||||
@@ -319,7 +319,7 @@ const QString straceWin::getBacktrace()
|
||||
SymEnumSymbols(hProcess, 0, NULL, EnumSymbolsCB, (PVOID)¶ms);
|
||||
#endif
|
||||
|
||||
QString insOffset = QString::fromLatin1("0x%1").arg(ihsf.InstructionOffset, 16, 16, QLatin1Char('0'));
|
||||
QString insOffset = u"0x%1"_qs.arg(ihsf.InstructionOffset, 16, 16, QChar(u'0'));
|
||||
auto formatLine = u"#%1 %2 %3 %4"_qs;
|
||||
#ifndef __MINGW32__
|
||||
formatLine += u"(%5)"_qs;
|
||||
@@ -333,7 +333,7 @@ const QString straceWin::getBacktrace()
|
||||
.arg(params.join(u", "));
|
||||
|
||||
if (!sourceFile.isEmpty())
|
||||
debugLine += QString::fromLatin1("[ %1 ]").arg(sourceFile);
|
||||
debugLine += u"[ %1 ]"_qs.arg(sourceFile);
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
@@ -74,18 +74,18 @@ namespace
|
||||
};
|
||||
|
||||
const Path configPath = specialFolderLocation(SpecialFolder::Config);
|
||||
migrate(QLatin1String("Preferences/WebUI/HTTPS/Certificate")
|
||||
, QLatin1String("Preferences/WebUI/HTTPS/CertificatePath")
|
||||
migrate(u"Preferences/WebUI/HTTPS/Certificate"_qs
|
||||
, u"Preferences/WebUI/HTTPS/CertificatePath"_qs
|
||||
, (configPath / Path(u"WebUICertificate.crt"_qs)));
|
||||
migrate(QLatin1String("Preferences/WebUI/HTTPS/Key")
|
||||
, QLatin1String("Preferences/WebUI/HTTPS/KeyPath")
|
||||
migrate(u"Preferences/WebUI/HTTPS/Key"_qs
|
||||
, u"Preferences/WebUI/HTTPS/KeyPath"_qs
|
||||
, (configPath / Path(u"WebUIPrivateKey.pem"_qs)));
|
||||
}
|
||||
|
||||
void upgradeTorrentContentLayout()
|
||||
{
|
||||
const QString oldKey {QLatin1String {"BitTorrent/Session/CreateTorrentSubfolder"}};
|
||||
const QString newKey {QLatin1String {"BitTorrent/Session/TorrentContentLayout"}};
|
||||
const QString oldKey = u"BitTorrent/Session/CreateTorrentSubfolder"_qs;
|
||||
const QString newKey = u"BitTorrent/Session/TorrentContentLayout"_qs;
|
||||
|
||||
SettingsStorage *settingsStorage {SettingsStorage::instance()};
|
||||
const auto oldData {settingsStorage->loadValue<QVariant>(oldKey)};
|
||||
@@ -104,8 +104,8 @@ namespace
|
||||
|
||||
void upgradeListenPortSettings()
|
||||
{
|
||||
const auto oldKey = QString::fromLatin1("BitTorrent/Session/UseRandomPort");
|
||||
const auto newKey = QString::fromLatin1("Preferences/Connection/PortRangeMin");
|
||||
const auto oldKey = u"BitTorrent/Session/UseRandomPort"_qs;
|
||||
const auto newKey = u"Preferences/Connection/PortRangeMin"_qs;
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
|
||||
if (settingsStorage->hasKey(oldKey))
|
||||
@@ -120,7 +120,7 @@ namespace
|
||||
void upgradeSchedulerDaysSettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = QString::fromLatin1("Preferences/Scheduler/days");
|
||||
const auto key = u"Preferences/Scheduler/days"_qs;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@@ -172,7 +172,7 @@ namespace
|
||||
void upgradeDNSServiceSettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = QString::fromLatin1("Preferences/DynDNS/Service");
|
||||
const auto key = u"Preferences/DynDNS/Service"_qs;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@@ -203,7 +203,7 @@ namespace
|
||||
void upgradeTrayIconStyleSettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = QString::fromLatin1("Preferences/Advanced/TrayIconStyle");
|
||||
const auto key = u"Preferences/Advanced/TrayIconStyle"_qs;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@@ -332,7 +332,7 @@ namespace
|
||||
void migrateProxySettingsEnum()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = QString::fromLatin1("Network/Proxy/Type");
|
||||
const auto key = u"Network/Proxy/Type"_qs;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@@ -400,7 +400,7 @@ bool upgrade(const bool /*ask*/)
|
||||
|
||||
void setCurrentMigrationVersion()
|
||||
{
|
||||
SettingsStorage::instance()->storeValue(QLatin1String(MIGRATION_VERSION_KEY), MIGRATION_VERSION);
|
||||
SettingsStorage::instance()->storeValue(QString::fromLatin1(MIGRATION_VERSION_KEY), MIGRATION_VERSION);
|
||||
}
|
||||
|
||||
void handleChangedDefaults(const DefaultPreferencesMode mode)
|
||||
@@ -414,7 +414,7 @@ void handleChangedDefaults(const DefaultPreferencesMode mode)
|
||||
|
||||
const DefaultValue changedDefaults[] =
|
||||
{
|
||||
{QLatin1String {"BitTorrent/Session/QueueingSystemEnabled"}, true, false}
|
||||
{u"BitTorrent/Session/QueueingSystemEnabled"_qs, true, false}
|
||||
};
|
||||
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
|
||||
Reference in New Issue
Block a user