author | llornkcor <llornkcor> | 2002-03-24 22:41:21 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-24 22:41:21 (UTC) |
commit | d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c (patch) (side-by-side diff) | |
tree | 195a7cbe7f9577a118d1bc05fb028fbc010279f7 /core | |
parent | 8cada0d43b00686567295e712f9c5c89e3977a7d (diff) | |
download | opie-d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c.zip opie-d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c.tar.gz opie-d8820a9f2bdf9bc98c99542e3613ca9b5d2c6e0c.tar.bz2 |
added lock icons
-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index 41e800c..acd50c2 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp @@ -176,52 +176,60 @@ void fileBrowser::populateList() while ( (fi=it.current()) ) { if (fi->isSymLink() ){ QString symLink=fi->readLink(); // qDebug("Symlink detected "+symLink); QFileInfo sym( symLink); fileS.sprintf( "%10li", sym.size() ); fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); fileDate = sym.lastModified().toString(); } else { // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); 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(isDir || fileL.find("/",0,TRUE) != -1) { + if( !QDir( fi->filePath() ).isReadable()) + pm = Resource::loadPixmap( "lockedfolder" ); item->setPixmap( 0,pm ); - else - item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); + } else { + if( !fi->isReadable() ) + pm = Resource::loadPixmap( "locked" ); + else + pm = Resource::loadPixmap( "fileopen" ); + item->setPixmap( 0,pm); + } if( fileL.find("->",0,TRUE) != -1) { // overlay link image 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(); fillCombo( (const QString &)currentPath); // dirPathCombo->lineEdit()->setText(currentPath); // if( dirPathStringList.grep(currentPath,TRUE).isEmpty() ) { // dirPathCombo->clear(); // dirPathStringList.prepend(currentPath ); // dirPathCombo->insertStringList( dirPathStringList,-1); // } } |