From addc3dfd8c2c5a5fcad19e9ae78f04d1ccdb2efa Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Wed, 24 Jan 2018 01:11:04 +0100 Subject: [PATCH] Launch at startup now working on Windows --- src/utils/confighandler.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index c0c2c89f..5797fea1 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -185,9 +185,10 @@ bool ConfigHandler::startupLaunchValue() { res = QFile(path).exists(); #elif defined(Q_OS_WIN) QSettings bootUpSettings( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", + "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat); - res = !bootUpSettings.value("Flameshot").toString().isEmpty(); + res = bootUpSettings.value("Flameshot").toString() == + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); #endif return res; } @@ -208,7 +209,8 @@ void ConfigHandler::setStartupLaunch(const bool start) { "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat); if (start) { - QString app_path = QCoreApplication::applicationFilePath(); + QString app_path = + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); bootUpSettings.setValue("Flameshot", app_path); } else { bootUpSettings.remove("Flameshot");