diff options
author | Ken Moore <moorekou@gmail.com> | 2016-08-18 12:56:16 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-08-18 12:56:16 -0400 |
commit | 01497728716ca641d34ee80ac4a657eac2311afa (patch) | |
tree | 18cf64d9549f30d0de253ee740c76ff174639f20 /src-qt5/core/lumina-desktop/AppMenu.cpp | |
parent | Adjust the XDGDesktopList static creation routine so that the static object i... (diff) | |
download | lumina-01497728716ca641d34ee80ac4a657eac2311afa.tar.gz lumina-01497728716ca641d34ee80ac4a657eac2311afa.tar.bz2 lumina-01497728716ca641d34ee80ac4a657eac2311afa.zip |
Setup the desktop to use the new XDGDesktopList directly (disables a lot of the extra managment overhead from the desktop itself).
Diffstat (limited to 'src-qt5/core/lumina-desktop/AppMenu.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop/AppMenu.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src-qt5/core/lumina-desktop/AppMenu.cpp b/src-qt5/core/lumina-desktop/AppMenu.cpp index ad3a2695..f1b16daa 100644 --- a/src-qt5/core/lumina-desktop/AppMenu.cpp +++ b/src-qt5/core/lumina-desktop/AppMenu.cpp @@ -12,8 +12,8 @@ AppMenu::AppMenu(QWidget* parent) : QMenu(parent){ appstorelink = LOS::AppStoreShortcut(); //Default application "store" to display (AppCafe in TrueOS) controlpanellink = LOS::ControlPanelShortcut(); //Default control panel APPS.clear(); - watcher = new QFileSystemWatcher(this); - connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherUpdate()) ); + //watcher = new QFileSystemWatcher(this); + //connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherUpdate()) ); //QTimer::singleShot(200, this, SLOT(start()) ); //Now start filling the menu start(); //do the initial run during session init so things are responsive immediately. connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(watcherUpdate()) ); @@ -32,14 +32,15 @@ QHash<QString, QList<XDGDesktop> >* 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<XDGDesktop> allfiles = LXDG::systemDesktopFiles(); + XDGDesktopList *sysApps = LXDG:: systemAppsList(); + QList<XDGDesktop> 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(); } |