diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index c0d44102..a9b87c25 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -318,31 +318,29 @@ bool ConfigHandler::startupLaunchValue() bool ConfigHandler::verifyLaunchFile() { - bool res = false; - #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) QString path = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, "autostart/", QStandardPaths::LocateDirectory) + "Flameshot.desktop"; - res = QFile(path).exists(); + bool res = QFile(path).exists(); #elif defined(Q_OS_WIN) QSettings bootUpSettings( "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat); - res = bootUpSettings.value("Flameshot").toString() == - QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); + bool res = + bootUpSettings.value("Flameshot").toString() == + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); #endif return res; } void ConfigHandler::setStartupLaunch(const bool start) { - - m_settings.setValue(QStringLiteral("startupLaunch"), start); if (start == m_settings.value(QStringLiteral("startupLaunch")).toBool()) { return; } + m_settings.setValue(QStringLiteral("startupLaunch"), start); #if defined(Q_OS_MACOS) /* TODO - there should be more correct way via API, but didn't find it without extra dependencies, there should be something like that: