-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 22 |
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 | |||
@@ -315,27 +315,32 @@ void AdvancedFm::populateLocalView() | |||
315 | 315 | ||
316 | if( !QDir( fi->filePath() ).isReadable()) //is directory | 316 | if( !QDir( fi->filePath() ).isReadable()) //is directory |
317 | pm = Resource::loadPixmap( "lockedfolder" ); | 317 | pm = Resource::loadPixmap( "lockedfolder" ); |
318 | else | 318 | else |
319 | pm= Resource::loadPixmap( "folder" ); | 319 | pm= Resource::loadPixmap( "folder" ); |
320 | // item->setPixmap( 0,pm ); | 320 | // item->setPixmap( 0,pm ); |
321 | } else if( fileInfo.isExecutable() || fs == "vfat" && fi->filePath().contains("/bin") ) { //is exec | 321 | } else if( (fileInfo.permission( QFileInfo::ExeUser) |
322 | pm = Resource::loadPixmap( "exec"); | 322 | | fileInfo.permission( QFileInfo::ExeGroup) |
323 | // item->setPixmap( 0,pm); | 323 | | fileInfo.permission( QFileInfo::ExeOther)) & fs.find("vfat",0,TRUE) == -1) { |
324 | pm = Resource::loadPixmap( "exec"); | ||
325 | // else { //is exec | ||
326 | // pm = Resource::loadPixmap( "exec"); | ||
327 | // } | ||
328 | // // item->setPixmap( 0,pm); | ||
324 | } else if( !fi->isReadable() ) { | 329 | } else if( !fi->isReadable() ) { |
325 | pm = Resource::loadPixmap( "locked" ); | 330 | pm = Resource::loadPixmap( "locked" ); |
326 | // item->setPixmap( 0,pm); | 331 | // item->setPixmap( 0,pm); |
327 | } else { //everything else goes by mimetype | 332 | } else { //everything else goes by mimetype |
328 | MimeType mt(fi->filePath()); | 333 | MimeType mt(fi->filePath()); |
329 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | 334 | pm=mt.pixmap(); //sets the correct pixmap for mimetype |
330 | if(pm.isNull()) | 335 | if(pm.isNull()) |
331 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | 336 | pm = Resource::loadPixmap( "UnknownDocument-14" ); |
332 | // item->setPixmap( 0,pm); | 337 | // item->setPixmap( 0,pm); |
333 | } | 338 | } |
334 | item->setPixmap( 0,pm); | 339 | item->setPixmap( 0,pm); |
335 | if( fi->isSymLink() &&fileL.find("->",0,TRUE) != -1) { | 340 | if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) { |
336 | // overlay link image | 341 | // overlay link image |
337 | pm= Resource::loadPixmap( "folder" ); | 342 | pm= Resource::loadPixmap( "folder" ); |
338 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 343 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
339 | QPainter painter( &pm ); | 344 | QPainter painter( &pm ); |
340 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 345 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
341 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | 346 | pm.setMask( pm.createHeuristicMask( FALSE ) ); |
@@ -421,24 +426,29 @@ void AdvancedFm::populateRemoteView() | |||
421 | if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) { | 426 | if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) { |
422 | fileL+="/"; | 427 | fileL+="/"; |
423 | isDir=TRUE; | 428 | isDir=TRUE; |
424 | // qDebug( fileL); | 429 | // qDebug( fileL); |
425 | } | 430 | } |
426 | } | 431 | } |
432 | QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL); | ||
427 | if(fileL !="./" && fi->exists()) { | 433 | if(fileL !="./" && fi->exists()) { |
428 | item= new QListViewItem( Remote_View, fileL, fileS, fileDate); | 434 | item= new QListViewItem( Remote_View, fileL, fileS, fileDate); |
429 | QPixmap pm; | 435 | QPixmap pm; |
430 | 436 | ||
431 | if(isDir || fileL.find("/",0,TRUE) != -1) { | 437 | if(isDir || fileL.find("/",0,TRUE) != -1) { |
432 | if( !QDir( fi->filePath() ).isReadable()) | 438 | if( !QDir( fi->filePath() ).isReadable()) |
433 | pm = Resource::loadPixmap( "lockedfolder" ); | 439 | pm = Resource::loadPixmap( "lockedfolder" ); |
434 | else | 440 | else |
435 | pm= Resource::loadPixmap( "folder" ); | 441 | pm= Resource::loadPixmap( "folder" ); |
436 | // item->setPixmap( 0,pm ); | 442 | // item->setPixmap( 0,pm ); |
437 | } else if( fi->isExecutable() || fs == "vfat" && fi->filePath().contains("/bin") ) { | 443 | } else if( (fileInfo.permission( QFileInfo::ExeUser) |
438 | pm = Resource::loadPixmap( "exec"); | 444 | | fileInfo.permission( QFileInfo::ExeGroup) |
445 | | fileInfo.permission( QFileInfo::ExeOther)) & fs.find("vfat",0,TRUE) == -1) { | ||
446 | pm = Resource::loadPixmap( "exec"); | ||
447 | ///// } else if(fileInfo.isExecutable()){ //is exec <<<< BROKEN!! | ||
448 | pm = Resource::loadPixmap( "exec"); | ||
439 | // item->setPixmap( 0,pm); | 449 | // item->setPixmap( 0,pm); |
440 | } else if( !fi->isReadable() ) { | 450 | } else if( !fi->isReadable() ) { |
441 | pm = Resource::loadPixmap( "locked" ); | 451 | pm = Resource::loadPixmap( "locked" ); |
442 | // item->setPixmap( 0,pm); | 452 | // item->setPixmap( 0,pm); |
443 | } else { | 453 | } else { |
444 | MimeType mt(fi->filePath()); | 454 | MimeType mt(fi->filePath()); |