refactor: allow proxy to load from registry if no file is provided
This commit is contained in:
parent
6bbebe75f9
commit
cf4fe32aab
1 changed files with 7 additions and 1 deletions
|
|
@ -25,7 +25,13 @@ QString getSystemSettingsBaseDir()
|
|||
|
||||
void QSettingsProxy::load(const QString &fileName)
|
||||
{
|
||||
m_pSettings = std::make_unique<QSettings>(fileName, QSettings::IniFormat);
|
||||
if (m_pSettings)
|
||||
m_pSettings.get()->deleteLater();
|
||||
|
||||
if (fileName.isEmpty())
|
||||
m_pSettings = std::make_unique<QSettings>(QSettings::NativeFormat, QSettings::UserScope, kAppName, kAppName);
|
||||
else
|
||||
m_pSettings = std::make_unique<QSettings>(fileName, QSettings::IniFormat);
|
||||
}
|
||||
|
||||
int QSettingsProxy::beginReadArray(const QString &prefix)
|
||||
|
|
|
|||
Loading…
Reference in a new issue