From 01497728716ca641d34ee80ac4a657eac2311afa Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 18 Aug 2016 12:56:16 -0400 Subject: Setup the desktop to use the new XDGDesktopList directly (disables a lot of the extra managment overhead from the desktop itself). --- src-qt5/core/libLumina/LuminaXDG.cpp | 1 + src-qt5/core/lumina-desktop/AppMenu.cpp | 13 +++++++------ src-qt5/core/lumina-desktop/AppMenu.h | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src-qt5') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index 338bfd15..c53fa2ef 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -35,6 +35,7 @@ void XDGDesktopList::updateList(){ QStringList found, newfiles; //for avoiding duplicate apps (might be files with same name in different priority directories) QStringList oldkeys = files.keys(); bool appschanged = false; + lastCheck = QDateTime::currentDateTime(); //Variables for internal loop use only (to prevent re-initializing variable on every iteration) bool ok; QString path; QDir dir; QStringList apps; XDGDesktop dFile; for(int i=0; i >* AppMenu::currentAppHash(){ // PRIVATE //=========== void AppMenu::updateAppList(){ - watcher->removePaths(watcher->directories()); + //watcher->removePaths(watcher->directories()); //Make sure the title/icon are updated as well (in case of locale/icon change) this->setTitle(tr("Applications")); this->setIcon( LXDG::findIcon("system-run","") ); //Now update the lists this->clear(); APPS.clear(); - QList allfiles = LXDG::systemDesktopFiles(); + XDGDesktopList *sysApps = LXDG:: systemAppsList(); + QList allfiles = sysApps->apps(false,false); //only valid, non-hidden apps APPS = LXDG::sortDesktopCats(allfiles); APPS.insert("All", LXDG::sortDesktopNames(allfiles)); lastHashUpdate = QDateTime::currentDateTime(); @@ -112,7 +113,7 @@ void AppMenu::updateAppList(){ } this->addMenu(menu); } - watcher->addPaths(LXDG::systemApplicationDirs()); + // watcher->addPaths(LXDG::systemApplicationDirs()); emit AppMenuUpdated(); } @@ -121,7 +122,7 @@ void AppMenu::updateAppList(){ //================= void AppMenu::start(){ //Setup the watcher - watcher->addPaths(LXDG::systemApplicationDirs()); + connect(LXDG:: systemAppsList(), SIGNAL(appsUpdated()), this, SLOT(watcherUpdate()) ); //Now fill the menu the first time updateAppList(); } diff --git a/src-qt5/core/lumina-desktop/AppMenu.h b/src-qt5/core/lumina-desktop/AppMenu.h index 42145e0c..7584de07 100644 --- a/src-qt5/core/lumina-desktop/AppMenu.h +++ b/src-qt5/core/lumina-desktop/AppMenu.h @@ -35,7 +35,7 @@ public: QDateTime lastHashUpdate; private: - QFileSystemWatcher *watcher; + //QFileSystemWatcher *watcher; QString appstorelink, controlpanellink; QList MLIST; QHash > APPS; @@ -55,4 +55,3 @@ signals: }; #endif - -- cgit