author | llornkcor <llornkcor> | 2002-03-25 02:46:56 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-25 02:46:56 (UTC) |
commit | b43c59f2f8da6edfa37042e0838b38702636f4d1 (patch) (side-by-side diff) | |
tree | 31913b2d26759d404c570c2164949da5b0796027 | |
parent | d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c (diff) | |
download | opie-b43c59f2f8da6edfa37042e0838b38702636f4d1.zip opie-b43c59f2f8da6edfa37042e0838b38702636f4d1.tar.gz opie-b43c59f2f8da6edfa37042e0838b38702636f4d1.tar.bz2 |
added more icon stuff
-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 @@ -10,24 +10,25 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ****************************************************************************/ #include "fileBrowser.h" #include "inputDialog.h" #include <qpe/config.h> #include <qpe/resource.h> #include <qpe/fileselector.h> #include <qpe/qpeapplication.h> #include <qpe/menubutton.h> +#include <qpe/mimetype.h> #include <qdict.h> #include <qwidgetstack.h> #include <qlistview.h> #include <qcombo.h> #include <qpushbutton.h> #include <qfile.h> #include <qmessagebox.h> #include <qlayout.h> #include <unistd.h> #include <qpopupmenu.h> #include <qlineedit.h> @@ -187,39 +188,45 @@ void fileBrowser::populateList() fileS.sprintf( "%10li", fi->size() ); fileL.sprintf( "%s",fi->fileName().data() ); fileDate= fi->lastModified().toString(); if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { fileL+="/"; isDir=TRUE; // qDebug( fileL); } } 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 ); pm.setMask( pm.createHeuristicMask( FALSE ) ); item->setPixmap( 0, pm); } } isDir=FALSE; ++it; } ListView->setSorting( 3, FALSE); QString currentPath = currentDir.canonicalPath(); |