1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 04:54:18 +00:00

Use char array directly

This eliminates the possibility of reassigning the pointer to another
address.
This commit is contained in:
Chocobo1 2021-10-28 14:15:23 +08:00
parent a5c531f0a4
commit 180deb867a
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -169,9 +169,9 @@ SettingsPtr Private::CustomProfile::applicationSettings(const QString &name) con
{ {
// here we force QSettings::IniFormat format always because we need it to be portable across platforms // here we force QSettings::IniFormat format always because we need it to be portable across platforms
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) #if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
constexpr const char *CONF_FILE_EXTENSION = ".ini"; const char CONF_FILE_EXTENSION[] = ".ini";
#else #else
constexpr const char *CONF_FILE_EXTENSION = ".conf"; const char CONF_FILE_EXTENSION[] = ".conf";
#endif #endif
const QString settingsFileName {QDir(configLocation()).absoluteFilePath(name + QLatin1String(CONF_FILE_EXTENSION))}; const QString settingsFileName {QDir(configLocation()).absoluteFilePath(name + QLatin1String(CONF_FILE_EXTENSION))};
return SettingsPtr(new QSettings(settingsFileName, QSettings::IniFormat)); return SettingsPtr(new QSettings(settingsFileName, QSettings::IniFormat));