diff options
author | Frerich Raabe <raabe@froglogic.com> | 2016-02-04 09:17:37 +0100 |
---|---|---|
committer | Katja Marttila <katja.marttila@theqtcompany.com> | 2016-02-15 06:15:09 +0000 |
commit | b28809d33975397bbf56058854240baad2498f63 (patch) | |
tree | 669f177a6503341aa975677d6714b3627aaf43e4 /src/sdk | |
parent | 85883d043b4a646e73fe502d801419dc9f73a101 (diff) |
Don't use 'lockmyApp' prefix for lock files
The 'lockmyApp' part of the lock file names looked like some generic
default value which just was not customized to fit the installer. Let's
use the Qt application name instead as returned by
QApplication::applicationName().
We maintain the strong random filename generation algorithm by sticking
to the proven constants which presumably are perfectly random since they
were generated by a fair die roll.
Change-Id: Ief18942ca4e967f7016e7c471a7b44e3b8ab8c95
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
Diffstat (limited to 'src/sdk')
-rw-r--r-- | src/sdk/installerbase.cpp | 5 | ||||
-rw-r--r-- | src/sdk/updatechecker.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 66503b334..37675e1b7 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -75,7 +75,10 @@ InstallerBase::~InstallerBase() int InstallerBase::run() { - RunOnceChecker runCheck(qApp->applicationDirPath() + QLatin1String("/lockmyApp1234865.lock")); + RunOnceChecker runCheck(qApp->applicationDirPath() + + QLatin1Char('/') + + qApp->applicationName() + + QLatin1String("1234865.lock")); if (runCheck.isRunning(RunOnceChecker::ConditionFlag::Lockfile)) { // It is possible to install an application and thus the maintenance tool into a // directory that requires elevated permission to create a lock file. Since this diff --git a/src/sdk/updatechecker.cpp b/src/sdk/updatechecker.cpp index b804096b7..1276ea436 100644 --- a/src/sdk/updatechecker.cpp +++ b/src/sdk/updatechecker.cpp @@ -53,7 +53,10 @@ UpdateChecker::UpdateChecker(int &argc, char *argv[]) int UpdateChecker::check() { - RunOnceChecker runCheck(qApp->applicationDirPath() + QLatin1String("/lockmyApp15021976.lock")); + RunOnceChecker runCheck(qApp->applicationDirPath() + + QLatin1Char('/') + + qApp->applicationName() + + QLatin1String("15021976.lock")); if (runCheck.isRunning(RunOnceChecker::ConditionFlag::Lockfile)) { // It is possible to install an application and thus the maintenance tool into a // directory that requires elevated permission to create a lock file. Since this |