Merge pull request #799 from amnezia-vpn/bugfix/fix-backup

Filter settings fields to backup
This commit is contained in:
pokamest 2024-05-21 04:11:41 -07:00 committed by GitHub
commit 2649dba4ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View file

@ -123,8 +123,27 @@ QByteArray SecureQSettings::backupAppConfig() const
{
QJsonObject cfg;
const auto needToBackup = [this](const auto &key) {
for (const auto &item : m_fieldsToBackup)
{
if (key == "Conf/installationUuid")
{
return false;
}
if (key.startsWith(item))
{
return true;
}
}
return false;
};
for (const QString &key : m_settings.allKeys()) {
if (key == "Conf/installationUuid") {
if (!needToBackup(key))
{
continue;
}