fix #539,update autostart to new desktop file

pull/1/head
Michail Vourlakos 8 years ago
parent 9ccf9978be
commit aa9e730422

@ -158,14 +158,23 @@ void GlobalSettings::setGlobalLaunchers(QStringList launchers)
bool GlobalSettings::autostart() const 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(); return autostartFile.exists();
} }
void GlobalSettings::setAutostart(bool state) void GlobalSettings::setAutostart(bool state)
{ {
QFile autostartFile(QDir::homePath() + "/.config/autostart/latte-dock.desktop"); //! remove old autostart file
QFile metaFile("/usr/share/applications/latte-dock.desktop"); 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()) { if (!state && autostartFile.exists()) {
//! the first time that the user disables the autostart, this is recorded //! the first time that the user disables the autostart, this is recorded

Loading…
Cancel
Save