From f48e3c027fad213ede48896d808d4facb089acd6 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 18 Aug 2016 13:48:50 -0400 Subject: Add the ability for Lumina to automatically add/remove symlinks from the ~/Desktop for applications that are installed/removed while the user session is active. --- src-qt5/core/lumina-desktop/AppMenu.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src-qt5') diff --git a/src-qt5/core/lumina-desktop/AppMenu.cpp b/src-qt5/core/lumina-desktop/AppMenu.cpp index f1b16daa..b239610a 100644 --- a/src-qt5/core/lumina-desktop/AppMenu.cpp +++ b/src-qt5/core/lumina-desktop/AppMenu.cpp @@ -40,6 +40,32 @@ void AppMenu::updateAppList(){ this->clear(); APPS.clear(); XDGDesktopList *sysApps = LXDG:: systemAppsList(); + //qDebug() << "New Apps List:"; + if(LSession::handle()->sessionSettings()->value("AutomaticDesktopAppLinks",true).toBool() && !lastHashUpdate.isNull() ){ + QString desktop = QDir::homePath()+"/"+tr("Desktop")+"/"; //translated desktop folder + if(!QFile::exists(desktop)){ + desktop = QDir::homePath()+"/Desktop/"; //desktop folder + if(!QFile::exists(desktop)){ + desktop = QDir::homePath()+"/desktop/"; //lowercase desktop folder + if(!QFile::exists(desktop)){ desktop.clear(); } + } + } + //qDebug() << "Update Desktop Folder:" << desktop << sysApps->removedApps << sysApps->newApps; + QStringList tmp = sysApps->removedApps; + for(int i=0; inewApps; + for(int i=0; i allfiles = sysApps->apps(false,false); //only valid, non-hidden apps APPS = LXDG::sortDesktopCats(allfiles); APPS.insert("All", LXDG::sortDesktopNames(allfiles)); -- cgit