diff options
author | Ken Moore <ken@pcbsd.org> | 2014-11-05 13:31:40 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2014-11-05 13:31:40 -0500 |
commit | d7b4dd01b7e8d803d3321dbc1eb3852cacf55e49 (patch) | |
tree | 76d208097a1b3255bd3056630aa12436c82c9acf | |
parent | Add a new utility: lumina-search (diff) | |
download | lumina-d7b4dd01b7e8d803d3321dbc1eb3852cacf55e49.tar.gz lumina-d7b4dd01b7e8d803d3321dbc1eb3852cacf55e49.tar.bz2 lumina-d7b4dd01b7e8d803d3321dbc1eb3852cacf55e49.zip |
Fix the display of a few of the search results in lumina-search
-rw-r--r-- | lumina-search/MainUI.cpp | 14 | ||||
-rw-r--r-- | lumina-search/MainUI.ui | 3 |
2 files changed, 13 insertions, 4 deletions
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 @@ <height>32</height> </size> </property> + <property name="textElideMode"> + <enum>Qt::ElideLeft</enum> + </property> </widget> </item> <item> |