diff options
author | Ken Moore <ken@pcbsd.org> | 2016-09-22 16:41:42 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2016-09-22 16:41:42 -0400 |
commit | 82ebebfb8a5867b400c1df726a478bdcb9d7c005 (patch) | |
tree | 6c799a122fba9dc9068695f95e967e417f6b1636 /src-qt5/core-utils/lumina-search | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | lumina-82ebebfb8a5867b400c1df726a478bdcb9d7c005.tar.gz lumina-82ebebfb8a5867b400c1df726a478bdcb9d7c005.tar.bz2 lumina-82ebebfb8a5867b400c1df726a478bdcb9d7c005.zip |
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).
Diffstat (limited to 'src-qt5/core-utils/lumina-search')
-rw-r--r-- | src-qt5/core-utils/lumina-search/MainUI.cpp | 4 | ||||
-rw-r--r-- | src-qt5/core-utils/lumina-search/Worker.cpp | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src-qt5/core-utils/lumina-search/MainUI.cpp b/src-qt5/core-utils/lumina-search/MainUI.cpp index 99b04b2b..93ee7411 100644 --- a/src-qt5/core-utils/lumina-search/MainUI.cpp +++ b/src-qt5/core-utils/lumina-search/MainUI.cpp @@ -169,8 +169,8 @@ void MainUI::foundSearchItem(QString path){ //Now setup the visuals if(path.simplified().endsWith(".desktop")){ bool ok = false; - XDGDesktop desk = LXDG::loadDesktopFile(path,ok); - if( !ok || !LXDG::checkValidity(desk) ){delete it; return; } //invalid file + XDGDesktop desk(path); + if( !desk.isValid() ){delete it; return; } //invalid file it->setText(desk.name); it->setIcon( LXDG::findIcon(desk.icon, "application-x-desktop") ); }else{ diff --git a/src-qt5/core-utils/lumina-search/Worker.cpp b/src-qt5/core-utils/lumina-search/Worker.cpp index b414a72f..025bcc1e 100644 --- a/src-qt5/core-utils/lumina-search/Worker.cpp +++ b/src-qt5/core-utils/lumina-search/Worker.cpp @@ -6,11 +6,13 @@ Worker::Worker(QObject *parent) : QObject(parent){ //Get the list of all applications and save them in an easily-searchable form - QList<XDGDesktop> apps = LXDG::systemDesktopFiles(); + QList<XDGDesktop*> apps = LXDG::systemDesktopFiles(); for(int i=0; i<apps.length(); i++){ - applist << ":::1:::"+apps[i].name+":::2:::"+apps[i].genericName+":::3:::"+apps[i].comment+":::4:::"+apps[i].filePath; + applist << ":::1:::"+apps[i]->name+":::2:::"+apps[i]->genericName+":::3:::"+apps[i]->comment+":::4:::"+apps[i]->filePath; } stopsearch = false; + //Clean up all the apps structures + for(int i=0; i<apps.length(); i++){ apps[i]->deleteLater(); } } Worker::~Worker(){ @@ -108,4 +110,4 @@ void Worker::beginsearch(){ } emit SearchUpdate( tr("Search Finished") ); emit SearchDone(); -}
\ No newline at end of file +} |