summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-01 02:24:51 (UTC)
committer llornkcor <llornkcor>2002-05-01 02:24:51 (UTC)
commit7e5615473c1d103db66f42ae60bf9ed57d52566c (patch) (side-by-side diff)
tree6074a903b03bb844c8d66edaa8d17ae068384288
parent1f6f336326e74534f65f88fe0045946b3d9f6d94 (diff)
downloadopie-7e5615473c1d103db66f42ae60bf9ed57d52566c.zip
opie-7e5615473c1d103db66f42ae60bf9ed57d52566c.tar.gz
opie-7e5615473c1d103db66f42ae60bf9ed57d52566c.tar.bz2
fixed a workaround for QFileInfo::isExecutable() stupid silly bug
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index ee3f736..a9ba3c2 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -309,39 +309,44 @@ void AdvancedFm::populateLocalView()
}
QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL);
if(fileL !="./" && fi->exists()) {
item= new QListViewItem( Local_View, fileL, fileS , fileDate);
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable()) //is directory
pm = Resource::loadPixmap( "lockedfolder" );
else
pm= Resource::loadPixmap( "folder" );
// item->setPixmap( 0,pm );
- } else if( fileInfo.isExecutable() || fs == "vfat" && fi->filePath().contains("/bin") ) { //is exec
- pm = Resource::loadPixmap( "exec");
-// item->setPixmap( 0,pm);
+ } else if( (fileInfo.permission( QFileInfo::ExeUser)
+ | fileInfo.permission( QFileInfo::ExeGroup)
+ | fileInfo.permission( QFileInfo::ExeOther)) & fs.find("vfat",0,TRUE) == -1) {
+ pm = Resource::loadPixmap( "exec");
+// else { //is exec
+// pm = Resource::loadPixmap( "exec");
+// }
+// // item->setPixmap( 0,pm);
} else if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
// item->setPixmap( 0,pm);
} else { //everything else goes by mimetype
MimeType mt(fi->filePath());
pm=mt.pixmap(); //sets the correct pixmap for mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
// item->setPixmap( 0,pm);
}
item->setPixmap( 0,pm);
- if( fi->isSymLink() &&fileL.find("->",0,TRUE) != -1) {
+ if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) {
// overlay link image
pm= Resource::loadPixmap( "folder" );
QPixmap lnk = Resource::loadPixmap( "opie/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;
}
@@ -415,36 +420,41 @@ void AdvancedFm::populateRemoteView()
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( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) {
fileL+="/";
isDir=TRUE;
// qDebug( fileL);
}
}
+ QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL);
if(fileL !="./" && fi->exists()) {
item= new QListViewItem( Remote_View, fileL, fileS, fileDate);
QPixmap pm;
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->isExecutable() || fs == "vfat" && fi->filePath().contains("/bin") ) {
- pm = Resource::loadPixmap( "exec");
+ } else if( (fileInfo.permission( QFileInfo::ExeUser)
+ | fileInfo.permission( QFileInfo::ExeGroup)
+ | fileInfo.permission( QFileInfo::ExeOther)) & fs.find("vfat",0,TRUE) == -1) {
+ pm = Resource::loadPixmap( "exec");
+///// } else if(fileInfo.isExecutable()){ //is exec <<<< BROKEN!!
+ pm = Resource::loadPixmap( "exec");
// item->setPixmap( 0,pm);
} else if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
// item->setPixmap( 0,pm);
} else {
MimeType mt(fi->filePath());
pm=mt.pixmap(); //sets the correct pixmap for mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
// item->setPixmap( 0,pm);
}
if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) {