diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index ec383610..2a258458 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include ConfigHandler::ConfigHandler() @@ -310,7 +311,10 @@ bool ConfigHandler::verifyLaunchFile() bool res = false; #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) - QString path = QDir::homePath() + "/.config/autostart/Flameshot.desktop"; + QString path = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, + "autostart/", + QStandardPaths::LocateDirectory) + + "Flameshot.desktop"; res = QFile(path).exists(); #elif defined(Q_OS_WIN) QSettings bootUpSettings( @@ -325,7 +329,9 @@ bool ConfigHandler::verifyLaunchFile() void ConfigHandler::setStartupLaunch(const bool start) { #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) - QString path = QDir::homePath() + "/.config/autostart/"; + QString path = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, + "autostart/", + QStandardPaths::LocateDirectory); QDir autostartDir(path); if (!autostartDir.exists()) { autostartDir.mkpath(".");