From 159d8e678880551fd77e63509e29f6f48b733535 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sat, 26 Jan 2019 10:34:38 -0500 Subject: Try to fix the start menu search lockup. Seems to fix it here, although I get a little bit of graphical artifacting while replacing the app menu items. --- src-qt5/core/libLumina/LuminaXDG.cpp | 11 +++++++++-- src-qt5/core/libLumina/LuminaXDG.h | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src-qt5/core/libLumina') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index 7726eed3..aad63a5e 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -517,6 +517,7 @@ void XDGDesktopList::watcherChanged(){ void XDGDesktopList::updateList(){ //run the check routine if(synctimer->isActive()){ synctimer->stop(); } + hashmutex.lock(); QStringList appDirs = LXDG::systemApplicationDirs(); //get all system directories QStringList found, newfiles; //for avoiding duplicate apps (might be files with same name in different priority directories) QStringList oldkeys = files.keys(); @@ -569,10 +570,12 @@ void XDGDesktopList::updateList(){ synctimer->setInterval(60000); //Update in 1 minute if nothing changes before then synctimer->start(); } + hashmutex.unlock(); } QList XDGDesktopList::apps(bool showAll, bool showHidden){ //showAll: include invalid files, showHidden: include NoShow/Hidden files + //hashmutex.lock(); QStringList keys = files.keys(); QList out; for(int i=0; i XDGDesktopList::apps(bool showAll, bool showHidden){ } } } + //hashmutex.unlock(); return out; } XDGDesktop* XDGDesktopList::findAppFile(QString filename){ + //hashmutex.lock(); QStringList keys = files.keys().filter(filename); QString chk = filename.section("/",-1); + XDGDesktop *found = 0; for(int i=0; i #include #include +#include // ====================== // FreeDesktop Desktop Actions Framework (data structure) @@ -117,6 +118,7 @@ private: QFileSystemWatcher *watcher; QTimer *synctimer; bool keepsynced; + QMutex hashmutex; private slots: void watcherChanged(); -- cgit