From d7b4dd01b7e8d803d3321dbc1eb3852cacf55e49 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 5 Nov 2014 13:31:40 -0500 Subject: Fix the display of a few of the search results in lumina-search --- lumina-search/MainUI.cpp | 14 ++++++++++---- lumina-search/MainUI.ui | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'lumina-search') diff --git a/lumina-search/MainUI.cpp b/lumina-search/MainUI.cpp index df247324..d7abcd65 100644 --- a/lumina-search/MainUI.cpp +++ b/lumina-search/MainUI.cpp @@ -103,15 +103,21 @@ void MainUI::foundSearchItem(QString path){ it->setWhatsThis(path); it->setToolTip(path); //Now setup the visuals - if(path.endsWith(".desktop")){ + if(path.simplified().endsWith(".desktop")){ bool ok = false; XDGDesktop desk = LXDG::loadDesktopFile(path,ok); - if(!ok){delete it; return; } //invalid file + if( !ok || !LXDG::checkValidity(desk) ){delete it; return; } //invalid file it->setText(desk.name); it->setIcon( LXDG::findIcon(desk.icon, "application-x-desktop") ); }else{ - it->setText( path.section("/",-1) ); - it->setIcon( LXDG::findMimeIcon(path.section(".",-1)) ); + if(QFileInfo(path).isDir()){ + it->setIcon( LXDG::findIcon("inode-directory","") ); + it->setText( path.replace(QDir::homePath(), "~") ); + }else{ + it->setIcon( LXDG::findMimeIcon(path.section("/",-1).section(".",-1)) ); + it->setText( path.section("/",-1) ); + } + } //Now add it to the widget ui->listWidget->addItem(it); diff --git a/lumina-search/MainUI.ui b/lumina-search/MainUI.ui index 91cee1ce..73c7bf18 100644 --- a/lumina-search/MainUI.ui +++ b/lumina-search/MainUI.ui @@ -65,6 +65,9 @@ 32 + + Qt::ElideLeft + -- cgit