diff options
Diffstat (limited to 'src/sdk/updatechecker.cpp')
-rw-r--r-- | src/sdk/updatechecker.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sdk/updatechecker.cpp b/src/sdk/updatechecker.cpp index edbec0eb5..63bac8b9f 100644 --- a/src/sdk/updatechecker.cpp +++ b/src/sdk/updatechecker.cpp @@ -32,10 +32,11 @@ #include <component.h> #include <errors.h> #include <init.h> -#include <kdrunoncechecker.h> +#include <runoncechecker.h> #include <packagemanagercore.h> #include <productkeycheck.h> +#include <QDir> #include <QDomDocument> #include <iostream> @@ -48,13 +49,16 @@ UpdateChecker::UpdateChecker(int &argc, char *argv[]) int UpdateChecker::check() { - KDRunOnceChecker runCheck(qApp->applicationDirPath() + QLatin1String("/lockmyApp15021976.lock")); - if (runCheck.isRunning(KDRunOnceChecker::ConditionFlag::Lockfile)) { + RunOnceChecker runCheck(QDir::tempPath() + + 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 // cannot be done without requesting credentials from the user, we silently ignore // the fact that we could not create the lock file and check the running processes. - if (runCheck.isRunning(KDRunOnceChecker::ConditionFlag::ProcessList)) + if (runCheck.isRunning(RunOnceChecker::ConditionFlag::ProcessList)) throw QInstaller::Error(QLatin1String("An instance is already checking for updates.")); } @@ -102,7 +106,7 @@ int UpdateChecker::check() foreach (QInstaller::Component *component, components) { QDomElement update = doc.createElement(QLatin1String("update")); update.setAttribute(QLatin1String("name"), component->value(QInstaller::scDisplayName)); - update.setAttribute(QLatin1String("version"), component->value(QInstaller::scRemoteVersion)); + update.setAttribute(QLatin1String("version"), component->value(QInstaller::scVersion)); update.setAttribute(QLatin1String("size"), component->value(QInstaller::scUncompressedSize)); root.appendChild(update); } |