From d4e90780226e6e910561654cc3a574623ddfa5cc Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 21 Sep 2016 12:07:45 -0400 Subject: Commit a small cleanup for the auto-loading of the apps list on the system. Going to check if this fixes the memory leak issue on some systems (have one I can test on now). --- src-qt5/core/libLumina/LuminaXDG.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src-qt5/core/libLumina/LuminaXDG.h') diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index 996e5a20..0397ce71 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -93,6 +93,7 @@ public slots: private: QFileSystemWatcher *watcher; QTimer *synctimer; + bool keepsynced; private slots: void watcherChanged(); -- cgit From de4b5c26801cc19956d0eb1e1d109b7024c8e368 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 21 Sep 2016 14:20:15 -0400 Subject: Add an "==" operator to the XDGDesktop class. Found a note in the QHash docs that any class type need this defined. --- src-qt5/core/libLumina/LuminaXDG.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src-qt5/core/libLumina/LuminaXDG.h') diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index 0397ce71..1720ebc5 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -68,6 +68,10 @@ public: //Constructor/destructor XDGDesktop(){} ~XDGDesktop(){} + + friend bool operator==(const XDGDesktop lhs, const XDGDesktop rhs){ + return lhs.filePath == rhs.filePath && lhs.lastRead == rhs.lastRead; + } }; // ======================== -- cgit From e24b7b3f822a55aa8210ed21d50349147426f7a3 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 21 Sep 2016 17:08:34 -0400 Subject: Fix the memory usage issue with Lumina and the application list on the system. It no longer grows with time that I can tell, but I am sure there is some additional cleanup and optimizations which can still be done later. --- src-qt5/core/libLumina/LuminaXDG.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src-qt5/core/libLumina/LuminaXDG.h') diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index 1720ebc5..5c012b9a 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -35,8 +35,8 @@ // ====================== // FreeDesktop Desktop Actions Framework (data structure) // ====================== -class XDGDesktopAction{ -public: +struct XDGDesktopAction{ +//public: //Admin variables QString ID; //The ID name for this action (should correspond to an entry in the "actionList" for the XDGDesktop below) //General Variables @@ -46,9 +46,10 @@ public: // ====================== // FreeDesktop Desktop Entry Framework (data structure) // ====================== -class XDGDesktop{ -public: +struct XDGDesktop{ +//public: enum XDGDesktopType { BAD, APP, LINK, DIR }; + //Admin variables QString filePath; //which file this structure contains the information for (absolute path) QDateTime lastRead; //when this structure was created from the file @@ -64,14 +65,15 @@ public: QList actions; //Type 2 (LINK) variables QString url; - + //Constructor/destructor XDGDesktop(){} - ~XDGDesktop(){} - - friend bool operator==(const XDGDesktop lhs, const XDGDesktop rhs){ - return lhs.filePath == rhs.filePath && lhs.lastRead == rhs.lastRead; - } + ~XDGDesktop(){ + actions.clear(); + showInList.clear(); notShowInList.clear(); actionList.clear(); mimeList.clear(); catList.clear(); keyList.clear(); + name.clear(); genericName.clear(); comment.clear(); icon.clear(); + exec.clear(); tryexec.clear(); path.clear(); startupWM.clear(); url.clear(); + } }; // ======================== -- cgit From 82ebebfb8a5867b400c1df726a478bdcb9d7c005 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 22 Sep 2016 16:41:42 -0400 Subject: Large update to how XDGDesktop files are created/used. This impacts almost all tools/utilities within Lumina - please test (passed internal tests so far). This cleans up a lot of the backend XDG compliance class, moving lots of functionality into child functions of the XDGDesktop class and ensuring that they get cleaned up more regularly/properly. This *seems* to make the desktop startup a lot faster, even if the overall memory savings are slight (so far). --- src-qt5/core/libLumina/LuminaXDG.h | 55 +++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 24 deletions(-) (limited to 'src-qt5/core/libLumina/LuminaXDG.h') diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index 5c012b9a..f2b1e3e2 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -46,8 +46,9 @@ struct XDGDesktopAction{ // ====================== // FreeDesktop Desktop Entry Framework (data structure) // ====================== -struct XDGDesktop{ -//public: +class XDGDesktop : public QObject{ + Q_OBJECT +public: enum XDGDesktopType { BAD, APP, LINK, DIR }; //Admin variables @@ -66,14 +67,18 @@ struct XDGDesktop{ //Type 2 (LINK) variables QString url; - //Constructor/destructor - XDGDesktop(){} - ~XDGDesktop(){ - actions.clear(); - showInList.clear(); notShowInList.clear(); actionList.clear(); mimeList.clear(); catList.clear(); keyList.clear(); - name.clear(); genericName.clear(); comment.clear(); icon.clear(); - exec.clear(); tryexec.clear(); path.clear(); startupWM.clear(); url.clear(); - } + //Constructor/destructor + XDGDesktop(QString filePath="", QObject *parent = 0); + ~XDGDesktop(){} + + //Functions for using this structure in various ways + void sync(); //syncronize this structure with the backend file(as listed in the "filePath" variable) + bool isValid(bool showAll = true); //See if this is a valid .desktop entry (showAll: don't filter out based on DE exclude/include lists) + + QString getDesktopExec(QString ActionID = ""); + bool saveDesktopFile(bool merge = true); //This will use the "filePath" variable for where to save the file + + bool setAutoStarted(bool autostart = true); }; // ======================== @@ -86,12 +91,12 @@ public: XDGDesktopList(QObject *parent = 0, bool watchdirs = false); ~XDGDesktopList(); //Main Interface functions - QList apps(bool showAll, bool showHidden); //showAll: include invalid files, showHidden: include NoShow/Hidden files + QList apps(bool showAll, bool showHidden); //showAll: include invalid files, showHidden: include NoShow/Hidden files //Administration variables (not typically used directly) QDateTime lastCheck; QStringList newApps, removedApps; //list of "new/removed" apps found during the last check - QHash files; /// + QHash files; /// public slots: void updateList(); //run the check routine @@ -114,7 +119,7 @@ signals: class LFileInfo : public QFileInfo{ private: QString mime, icon; - XDGDesktop desk; + XDGDesktop *desk; void loadExtraInfo(); @@ -122,7 +127,9 @@ public: //Couple overloaded contructors LFileInfo(QString filepath); LFileInfo(QFileInfo info); - ~LFileInfo(){} + ~LFileInfo(){ + desk->deleteLater(); + } //Functions for accessing the extra information // -- Return the mimetype for the file @@ -149,25 +156,25 @@ typedef QList LFileInfoList; class LXDG{ public: //Read/write a *.desktop file - static XDGDesktop loadDesktopFile(QString filePath, bool& ok); - static bool saveDesktopFile(XDGDesktop dFile, bool merge = true); + //static XDGDesktop* loadDesktopFile(QString filepath, bool&ok, QObject *parent = 0); + //static bool saveDesktopFile(XDGDesktop *dFile, bool merge = true); //Check a *.desktop file for validity (showAll skips the DE-exclusivity checks) - static bool checkValidity(XDGDesktop dFile, bool showAll = true); + //static bool checkValidity(XDGDesktop *dFile, bool showAll = true); //Check for a valid executable static bool checkExec(QString exec); //Get a list of all the directories where *.desktop files exist static QStringList systemApplicationDirs(); //Get a list of all the *.desktop files available on the system - static XDGDesktopList* systemAppsList(); //return a pointer to the entire class - static QList systemDesktopFiles(bool showAll = false, bool showHidden = false); //simplification for getting just the files + //static XDGDesktopList* systemAppsList(); //return a pointer to the entire class + static QList systemDesktopFiles(bool showAll = false, bool showHidden = false); //simplification for getting just the files //Sort a list of Desktop files into the proper categories - static QHash< QString, QList > sortDesktopCats(QList apps); + static QHash< QString, QList > sortDesktopCats(QList apps); //Return the icon to use for the given category static QString DesktopCatToIcon(QString cat); //Sort a list of Desktop files by name - static QList sortDesktopNames(QList apps); + static QList sortDesktopNames(QList apps); //Get the executable line from a Desktop file - static QString getDesktopExec(XDGDesktop app, QString ActionID = ""); + //static QString getDesktopExec(XDGDesktop *app, QString ActionID = ""); //Set all the default XDG Environment variables static void setEnvironmentVars(); //Find an icon from the current/default theme @@ -198,8 +205,8 @@ public: static QStringList loadMimeFileGlobs2(); //Find all the autostart *.desktop files - static QList findAutoStartFiles(bool includeInvalid = false); - static bool setAutoStarted(bool autostart, XDGDesktop app); + static QList findAutoStartFiles(bool includeInvalid = false); + //static bool setAutoStarted(bool autostart, XDGDesktop *app); static bool setAutoStarted(bool autostart, QString filePath); //for convenience }; -- cgit From 63069bcc5f0cd5dd0f489ebdbd0c12250e01bd03 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 23 Sep 2016 09:44:43 -0400 Subject: Finish up the depretiation of the old systemapps fetching function. --- src-qt5/core/libLumina/LuminaXDG.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/core/libLumina/LuminaXDG.h') diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index f2b1e3e2..dd9d1c67 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -166,7 +166,7 @@ public: static QStringList systemApplicationDirs(); //Get a list of all the *.desktop files available on the system //static XDGDesktopList* systemAppsList(); //return a pointer to the entire class - static QList systemDesktopFiles(bool showAll = false, bool showHidden = false); //simplification for getting just the files + //static QList systemDesktopFiles(bool showAll = false, bool showHidden = false); //simplification for getting just the files //Sort a list of Desktop files into the proper categories static QHash< QString, QList > sortDesktopCats(QList apps); //Return the icon to use for the given category -- cgit From 57acfa1f6e5fe255c60a863e3056b2468d5bfb42 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 28 Sep 2016 08:30:08 -0400 Subject: Add an additional default-valued constructor for LFileInfo. --- src-qt5/core/libLumina/LuminaXDG.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src-qt5/core/libLumina/LuminaXDG.h') diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index dd9d1c67..acb688ff 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -125,6 +125,7 @@ private: public: //Couple overloaded contructors + LFileInfo(); LFileInfo(QString filepath); LFileInfo(QFileInfo info); ~LFileInfo(){ -- cgit From af6ce6ea4f6b62d0b09b0b9ae2f8d640e828802a Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 25 Oct 2016 11:54:57 -0400 Subject: Add PulseAudio support into the FreeBSD backend if a PICO session is detected. --- src-qt5/core/libLumina/LuminaXDG.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src-qt5/core/libLumina/LuminaXDG.h') diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index acb688ff..1c86cedb 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -64,6 +64,9 @@ public: QStringList actionList, mimeList, catList, keyList; bool useTerminal, startupNotify; QList actions; + //Type 1 Extensions for Lumina (Optional) + bool useVGL; //X-VGL + //Type 2 (LINK) variables QString url; -- cgit