mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
Merge pull request #799 from amnezia-vpn/bugfix/fix-backup
Filter settings fields to backup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user