logic: Application moving protection, licensegenerator for other licensetypes

* Licensegenerator can now generate any type of license via commandline argument
* When moving the appliction, the user needs to enter the License again
This commit is contained in:
Andreas Stallinger
2016-02-10 12:52:00 +01:00
parent 082b94ac8d
commit 50a94bf108
12 changed files with 117 additions and 41 deletions
+11 -3
View File
@@ -45,9 +45,17 @@ void QtLicense::load()
{
clear();
License license;
bool isLoaded = license.loadFromEncodedString(
ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath());
if (!isLoaded)
{
return;
}
if (m_licenseText)
{
m_licenseText->setText(ApplicationSettings::getInstance()->getLicenseString().c_str());
m_licenseText->setText(license.getLicenseString().c_str());
}
}
@@ -148,8 +156,8 @@ void QtLicense::handleUpdateButtonPress()
if (license.isValid())
{
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
appSettings->setLicenseString(license.getLicenseString());
std::string appLocation = AppPath::getAppPath(); // for easier debugging
std::string appLocation = AppPath::getAppPath();
appSettings->setLicenseString(license.getLicenseEncodedString(appLocation));
FilePath p(appLocation);
appSettings->setLicenseCheck(license.hashLocation(p.absolute().str()));
appSettings->save();