mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Proper fix to use an INI file instead of the registry on Windows
This commit is contained in:
@@ -48,13 +48,15 @@ public:
|
||||
#ifdef Q_WS_WIN
|
||||
QVariant value(const QString & key, const QVariant &defaultValue = QVariant()) const {
|
||||
QVariant ret = QSettings::value(key);
|
||||
if(format() == QSettings::NativeFormat && ret.isNull()) {
|
||||
// Fallback on Windows, use \ in key instead of /
|
||||
if(key.contains("/")) {
|
||||
ret = QSettings::value(key.replace("/", "\\"));
|
||||
} else {
|
||||
if(key.contains("\\")) {
|
||||
ret = QSettings::value(key.replace("\\", "/"));
|
||||
if(format() == QSettings::NativeFormat) {
|
||||
if(ret.isNull()) {
|
||||
// Fallback on Windows, use \ in key instead of /
|
||||
if(key.contains("/")) {
|
||||
ret = QSettings::value(key.replace("/", "\\"));
|
||||
} else {
|
||||
if(key.contains("\\")) {
|
||||
ret = QSettings::value(key.replace("\\", "/"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user