Skip to content

Commit

Permalink
fix #539,update autostart to new desktop file
Browse files Browse the repository at this point in the history
  • Loading branch information
psifidotos committed Jun 13, 2017
1 parent 2f97e60 commit 81b8e94
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions app/globalsettings.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 81b8e94

Please sign in to comment.