aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core-utils/lumina-search/MainUI.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2016-12-14 21:52:08 +0000
committerWeblate <noreply@weblate.org>2016-12-14 21:52:08 +0000
commitf274dd0526568b50e113baa85fcb26a87575eed9 (patch)
treecabcdb147e5dbf2cbe4c321c5ad59963c40c3e89 /src-qt5/core-utils/lumina-search/MainUI.cpp
parentTranslated using Weblate (lumina_CONFIG@sl (generated)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-f274dd0526568b50e113baa85fcb26a87575eed9.tar.gz
lumina-f274dd0526568b50e113baa85fcb26a87575eed9.tar.bz2
lumina-f274dd0526568b50e113baa85fcb26a87575eed9.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/core-utils/lumina-search/MainUI.cpp')
-rw-r--r--src-qt5/core-utils/lumina-search/MainUI.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src-qt5/core-utils/lumina-search/MainUI.cpp b/src-qt5/core-utils/lumina-search/MainUI.cpp
index 99b04b2b..b3e28f8a 100644
--- a/src-qt5/core-utils/lumina-search/MainUI.cpp
+++ b/src-qt5/core-utils/lumina-search/MainUI.cpp
@@ -17,7 +17,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
ui->tool_configure->setVisible(false); //app search initially set
livetime = new QTimer(this);
- livetime->setInterval(300); //1/3 second for live searches
+ livetime->setInterval(500); //1/2 second for live searches
livetime->setSingleShot(true);
workthread = new QThread(this);
@@ -56,6 +56,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
}
MainUI::~MainUI(){
+ searcher->StopSearch();
workthread->quit();
workthread->wait();
}
@@ -169,8 +170,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{
@@ -189,6 +190,7 @@ void MainUI::foundSearchItem(QString path){
}
//Now add it to the widget
ui->listWidget->addItem(it);
+ if(ui->listWidget->count()>100){ searcher->StopSearch(); } //just in case
}
void MainUI::stopSearch(){
bgstack15