Merge pull request #6766 from symless/issue-6760-license

Fixed Synergy loseing license when creating a System scope config
This commit is contained in:
Jnewbon 2020-09-14 15:02:08 +01:00 committed by GitHub
commit ea3bfec430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,7 @@ v1.12.x-snapshot
===========
Bug fixes:
- #6753 Fixed a number of vulnerabilities detected by static analysis
- #6760 Synergy loses license when creating a System scope config
Enhancements:
- #6750 Integrate SonarCloud for static analysis and test coverage

View File

@ -238,7 +238,6 @@ void AppConfig::loadSettings()
m_ActivateEmail = loadSetting(kActivateEmail, "").toString();
m_CryptoEnabled = loadSetting(kCryptoEnabled, true).toBool();
m_AutoHide = loadSetting(kAutoHide, false).toBool();
m_Serialkey = loadSetting(kSerialKey, "").toString().trimmed();
m_lastVersion = loadSetting(kLastVersion, "Unknown").toString();
m_LastExpiringWarningTime = loadSetting(kLastExpireWarningTime, 0).toInt();
m_ActivationHasRun = loadSetting(kActivationHasRun, false).toBool();
@ -251,6 +250,16 @@ void AppConfig::loadSettings()
m_ClientGroupChecked = loadSetting(kGroupClientCheck, true).toBool();
m_ServerHostname = loadSetting(kServerHostname).toString();
//only change the serial key if the settings being loaded contains a key
bool updateSerial = GUI::Config::ConfigWriter::make()
->hasSetting(settingName(kLoadSystemSettings),GUI::Config::ConfigWriter::kCurrent);
//if the setting exists and is not empty
updateSerial = updateSerial && !loadSetting(kSerialKey, "").toString().trimmed().isEmpty();
if (updateSerial) {
m_Serialkey = loadSetting(kSerialKey, "").toString().trimmed();
}
//Set the default path of the TLS certificate file in the users DIR
QString certificateFilename = QString("%1/%2/%3").arg(m_CoreInterface.getProfileDir(),
"SSL",