From aa9e7304229039ac4a705a26eb112ba82ade6f37 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 13 Jun 2017 13:51:11 +0300 Subject: [PATCH] fix #539,update autostart to new desktop file --- app/globalsettings.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/globalsettings.cpp b/app/globalsettings.cpp index daaadb19c..d91e1517b 100644 --- a/app/globalsettings.cpp +++ b/app/globalsettings.cpp @@ -158,14 +158,23 @@ void GlobalSettings::setGlobalLaunchers(QStringList launchers) bool GlobalSettings::autostart() const { - QFile autostartFile(QDir::homePath() + "/.config/autostart/latte-dock.desktop"); + QFile autostartFile(QDir::homePath() + "/.config/autostart/org.kde.latte-dock.desktop"); return autostartFile.exists(); } void GlobalSettings::setAutostart(bool state) { - QFile autostartFile(QDir::homePath() + "/.config/autostart/latte-dock.desktop"); - QFile metaFile("/usr/share/applications/latte-dock.desktop"); + //! remove old autostart file + QFile oldAutostartFile(QDir::homePath() + "/.config/autostart/latte-dock.desktop"); + + if (oldAutostartFile.exists()) { + oldAutostartFile.remove(); + } + + //! end of removal of old autostart file + + QFile autostartFile(QDir::homePath() + "/.config/autostart/org.kde.latte-dock.desktop"); + QFile metaFile("/usr/share/applications/org.kde.latte-dock.desktop"); if (!state && autostartFile.exists()) { //! the first time that the user disables the autostart, this is recorded