Browse Source

Still cleaning up registry access code

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
7f71e3981e
  1. 15
      src/qinisettings.h

15
src/qinisettings.h

@ -62,18 +62,7 @@ public: @@ -62,18 +62,7 @@ public:
QString key_tmp(key);
QVariant ret = QSettings::value(key_tmp);
if(ret.isNull()) {
if(format() == QSettings::NativeFormat) {
// Fallback on Windows, use \ in key instead of /
if(key_tmp.contains("/")) {
ret = QSettings::value(key_tmp.replace("/", "\\"));
} else {
if(key_tmp.contains("\\")) {
ret = QSettings::value(key_tmp.replace("\\", "/"));
}
}
} else {
if(format() != QSettings::NativeFormat) {
// Keep compatibility with qBittorrent < 2.3.0
// Import the setting from the registry
QSettings old_settings(organizationName(), applicationName());
@ -92,7 +81,7 @@ public: @@ -92,7 +81,7 @@ public:
void setValue(const QString &key, const QVariant &val) {
QString key_tmp(key);
if(format() == QSettings::NativeFormat)
key_tmp = key_tmp.replace("/", "\\");
key_tmp = key_tmp.replace("\\", "/");
QSettings::setValue(key_tmp, val);
}
#endif

Loading…
Cancel
Save