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.cpp | 27 +++++++++------------------ src-qt5/core/libLumina/LuminaXDG.h | 22 ++++++++++++---------- 2 files changed, 21 insertions(+), 28 deletions(-) (limited to 'src-qt5/core') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index e500ab7e..36b05676 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -48,7 +48,7 @@ void XDGDesktopList::updateList(){ bool firstrun = lastCheck.isNull() || oldkeys.isEmpty(); 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; + bool ok; QString path; QDir dir; QStringList apps; for(int i=0; istart(); } - files.squeeze(); //make sure this class uses as little memory as possible (should not be needed - but just in case...) } QList XDGDesktopList::apps(bool showAll, bool showHidden){ @@ -97,8 +97,8 @@ QList XDGDesktopList::apps(bool showAll, bool showHidden){ QStringList keys = files.keys(); QList out; for(int i=0; i 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