aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp1
-rw-r--r--src-qt5/core/lumina-desktop/AppMenu.cpp13
-rw-r--r--src-qt5/core/lumina-desktop/AppMenu.h3
3 files changed, 9 insertions, 8 deletions
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<appDirs.length(); i++){
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();
}
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<QMenu> MLIST;
QHash<QString, QList<XDGDesktop> > APPS;
@@ -55,4 +55,3 @@ signals:
};
#endif
-
bgstack15