logic: Fixed cli message handling and Mac build

This commit is contained in:
Eberhard Graether
2017-08-10 01:17:26 +02:00
parent 9269468a7b
commit ece2cbfe14
10 changed files with 48 additions and 78 deletions
+5 -6
View File
@@ -104,16 +104,17 @@ int utility::getIdealThreadCount()
return QThread::idealThreadCount();
}
bool utility::saveLicense(License* license)
bool utility::saveLicense(const License* license)
{
if (license == nullptr)
{
return false;
}
if (license->isValid())
{
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
if (appSettings == NULL)
if (appSettings == nullptr)
{
LOG_ERROR_STREAM(<< "Unable to retrieve app settings");
return false;
@@ -121,10 +122,8 @@ bool utility::saveLicense(License* license)
std::string appLocation = AppPath::getAppPath();
appSettings->setLicenseString(license->getLicenseEncodedString(appLocation));
FilePath p(appLocation);
appSettings->setLicenseCheck(license->hashLocation(p.absolute().str()));
appSettings->save(UserPaths::getAppSettingsPath());
appSettings->setLicenseCheck(license->hashLocation(FilePath(appLocation).absolute().str()));
appSettings->save();
return true;
}
else