mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Replace single-character string with character literal
Also remove unnecessary dynamic allocation.
This commit is contained in:
parent
7e3cf99bb9
commit
0217d5b4c0
32 changed files with 96 additions and 96 deletions
|
@ -256,7 +256,7 @@ void Preferences::setWinStartup(bool b)
|
|||
{
|
||||
QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
|
||||
if (b) {
|
||||
const QString binPath = "\"" + Utils::Fs::toNativePath(qApp->applicationFilePath()) + "\"";
|
||||
const QString binPath = '"' + Utils::Fs::toNativePath(qApp->applicationFilePath()) + '"';
|
||||
settings.setValue("qBittorrent", binPath);
|
||||
}
|
||||
else {
|
||||
|
@ -500,7 +500,7 @@ void Preferences::setWebUiAuthSubnetWhitelist(QStringList subnets)
|
|||
|
||||
QString Preferences::getServerDomains() const
|
||||
{
|
||||
return value("Preferences/WebUI/ServerDomains", "*").toString();
|
||||
return value("Preferences/WebUI/ServerDomains", '*').toString();
|
||||
}
|
||||
|
||||
void Preferences::setServerDomains(const QString &str)
|
||||
|
@ -510,7 +510,7 @@ void Preferences::setServerDomains(const QString &str)
|
|||
|
||||
QString Preferences::getWebUiAddress() const
|
||||
{
|
||||
return value("Preferences/WebUI/Address", "*").toString().trimmed();
|
||||
return value("Preferences/WebUI/Address", '*').toString().trimmed();
|
||||
}
|
||||
|
||||
void Preferences::setWebUiAddress(const QString &addr)
|
||||
|
@ -987,7 +987,7 @@ QString Preferences::getPythonPath()
|
|||
// Fallback: Detect python from default locations
|
||||
const QStringList dirs = QDir("C:/").entryList(QStringList("Python*"), QDir::Dirs, QDir::Name | QDir::Reversed);
|
||||
foreach (const QString &dir, dirs) {
|
||||
const QString path("C:/" + dir + "/");
|
||||
const QString path("C:/" + dir + '/');
|
||||
if (QFile::exists(path + "python.exe"))
|
||||
return path;
|
||||
}
|
||||
|
@ -1058,8 +1058,8 @@ void Preferences::setMagnetLinkAssoc(bool set)
|
|||
|
||||
// Magnet association
|
||||
if (set) {
|
||||
const QString commandStr = "\"" + qApp->applicationFilePath() + "\" \"%1\"";
|
||||
const QString iconStr = "\"" + qApp->applicationFilePath() + "\",1";
|
||||
const QString commandStr = '"' + qApp->applicationFilePath() + "\" \"%1\"";
|
||||
const QString iconStr = '"' + qApp->applicationFilePath() + "\",1";
|
||||
|
||||
settings.setValue("magnet/Default", "URL:Magnet link");
|
||||
settings.setValue("magnet/Content Type", "application/x-magnet");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue