-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index acd50c2..ebb78d1 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp @@ -19,6 +19,7 @@ #include <qpe/fileselector.h> #include <qpe/qpeapplication.h> #include <qpe/menubutton.h> +#include <qpe/mimetype.h> #include <qdict.h> #include <qwidgetstack.h> @@ -196,21 +197,27 @@ void fileBrowser::populateList() if(fileL !="./") { item= new QListViewItem( ListView,fileL,fileS , fileDate); QPixmap pm; - pm= Resource::loadPixmap( "folder" ); if(isDir || fileL.find("/",0,TRUE) != -1) { if( !QDir( fi->filePath() ).isReadable()) pm = Resource::loadPixmap( "lockedfolder" ); + else + pm= Resource::loadPixmap( "folder" ); item->setPixmap( 0,pm ); } else { if( !fi->isReadable() ) pm = Resource::loadPixmap( "locked" ); - else - pm = Resource::loadPixmap( "fileopen" ); + else { + MimeType mt(fi->filePath()); + pm=mt.pixmap(); + if(pm.isNull()) + pm = Resource::loadPixmap( "UnknownDocument-14" ); item->setPixmap( 0,pm); } + } if( fileL.find("->",0,TRUE) != -1) { // overlay link image + pm= Resource::loadPixmap( "folder" ); QPixmap lnk = Resource::loadPixmap( "symlink" ); QPainter painter( &pm ); painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |