summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-02 02:42:45 (UTC)
committer llornkcor <llornkcor>2002-05-02 02:42:45 (UTC)
commitdd8d5784a9ef93b0d4ed7b6d1751942a904ab7cb (patch) (unidiff)
tree2f40da1aec6e66dd9c67eb73297561c9e5a64e2b
parent6dfc6f34420b8c9222d1c785efc950fc5031a7f0 (diff)
downloadopie-dd8d5784a9ef93b0d4ed7b6d1751942a904ab7cb.zip
opie-dd8d5784a9ef93b0d4ed7b6d1751942a904ab7cb.tar.gz
opie-dd8d5784a9ef93b0d4ed7b6d1751942a904ab7cb.tar.bz2
bug on vfat workaround... sorta
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 7cd8644..b224deb 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -291,65 +291,66 @@ void AdvancedFm::populateLocalView()
291 QFileInfo *fi; 291 QFileInfo *fi;
292 while ( (fi=it.current()) ) { 292 while ( (fi=it.current()) ) {
293 if (fi->isSymLink() ) { 293 if (fi->isSymLink() ) {
294 QString symLink=fi->readLink(); 294 QString symLink=fi->readLink();
295// qDebug("Symlink detected "+symLink); 295// qDebug("Symlink detected "+symLink);
296 QFileInfo sym( symLink); 296 QFileInfo sym( symLink);
297 fileS.sprintf( "%10li", sym.size() ); 297 fileS.sprintf( "%10li", sym.size() );
298 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); 298 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() );
299 fileDate = sym.lastModified().toString(); 299 fileDate = sym.lastModified().toString();
300 } else { 300 } else {
301 fileS.sprintf( "%10li", fi->size() ); 301 fileS.sprintf( "%10li", fi->size() );
302 fileL.sprintf( "%s",fi->fileName().data() ); 302 fileL.sprintf( "%s",fi->fileName().data() );
303 fileDate= fi->lastModified().toString(); 303 fileDate= fi->lastModified().toString();
304 if( QDir(QDir::cleanDirPath( currentDir.canonicalPath()+"/"+fileL)).exists() ) { 304 if( QDir(QDir::cleanDirPath( currentDir.canonicalPath()+"/"+fileL)).exists() ) {
305 fileL+="/"; 305 fileL+="/";
306 isDir=TRUE; 306 isDir=TRUE;
307// qDebug( fileL); 307// qDebug( fileL);
308 } 308 }
309 } 309 }
310 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL); 310 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL);
311 if(fileL !="./" && fi->exists()) { 311 if(fileL !="./" && fi->exists()) {
312 item= new QListViewItem( Local_View, fileL, fileS , fileDate); 312 item= new QListViewItem( Local_View, fileL, fileS , fileDate);
313 313
314 if(isDir || fileL.find("/",0,TRUE) != -1) { 314 if(isDir || fileL.find("/",0,TRUE) != -1) {
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.permission( QFileInfo::ExeUser) 321 } else if( (fileInfo.permission( QFileInfo::ExeUser)
322 | fileInfo.permission( QFileInfo::ExeGroup) 322 | fileInfo.permission( QFileInfo::ExeGroup)
323 | fileInfo.permission( QFileInfo::ExeOther)) & fs.find("vfat",0,TRUE) == -1) { 323 | fileInfo.permission( QFileInfo::ExeOther))
324 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
324 pm = Resource::loadPixmap( "exec"); 325 pm = Resource::loadPixmap( "exec");
325// else { //is exec 326// else { //is exec
326// pm = Resource::loadPixmap( "exec"); 327// pm = Resource::loadPixmap( "exec");
327// } 328// }
328// // item->setPixmap( 0,pm); 329// // item->setPixmap( 0,pm);
329 } else if( !fi->isReadable() ) { 330 } else if( !fi->isReadable() ) {
330 pm = Resource::loadPixmap( "locked" ); 331 pm = Resource::loadPixmap( "locked" );
331// item->setPixmap( 0,pm); 332// item->setPixmap( 0,pm);
332 } else { //everything else goes by mimetype 333 } else { //everything else goes by mimetype
333 MimeType mt(fi->filePath()); 334 MimeType mt(fi->filePath());
334 pm=mt.pixmap(); //sets the correct pixmap for mimetype 335 pm=mt.pixmap(); //sets the correct pixmap for mimetype
335 if(pm.isNull()) 336 if(pm.isNull())
336 pm = Resource::loadPixmap( "UnknownDocument-14" ); 337 pm = Resource::loadPixmap( "UnknownDocument-14" );
337// item->setPixmap( 0,pm); 338// item->setPixmap( 0,pm);
338 } 339 }
339 item->setPixmap( 0,pm); 340 item->setPixmap( 0,pm);
340 if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) { 341 if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) {
341 // overlay link image 342 // overlay link image
342 pm= Resource::loadPixmap( "folder" ); 343 pm= Resource::loadPixmap( "folder" );
343 QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 344 QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
344 QPainter painter( &pm ); 345 QPainter painter( &pm );
345 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 346 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
346 pm.setMask( pm.createHeuristicMask( FALSE ) ); 347 pm.setMask( pm.createHeuristicMask( FALSE ) );
347 item->setPixmap( 0, pm); 348 item->setPixmap( 0, pm);
348 } 349 }
349 } 350 }
350 isDir=FALSE; 351 isDir=FALSE;
351 ++it; 352 ++it;
352 } 353 }
353 354
354 if(currentDir.canonicalPath().find("dev",0,TRUE) != -1) { 355 if(currentDir.canonicalPath().find("dev",0,TRUE) != -1) {
355 struct stat buf; 356 struct stat buf;
@@ -413,65 +414,66 @@ void AdvancedFm::populateRemoteView()
413 while ( (fi=it.current()) ) { 414 while ( (fi=it.current()) ) {
414 if (fi->isSymLink() ){ 415 if (fi->isSymLink() ){
415 QString symLink=fi->readLink(); 416 QString symLink=fi->readLink();
416// qDebug("Symlink detected "+symLink); 417// qDebug("Symlink detected "+symLink);
417 QFileInfo sym( symLink); 418 QFileInfo sym( symLink);
418 fileS.sprintf( "%10li", sym.size() ); 419 fileS.sprintf( "%10li", sym.size() );
419 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); 420 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() );
420 fileDate = sym.lastModified().toString(); 421 fileDate = sym.lastModified().toString();
421 } else { 422 } else {
422// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); 423// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
423 fileS.sprintf( "%10li", fi->size() ); 424 fileS.sprintf( "%10li", fi->size() );
424 fileL.sprintf( "%s",fi->fileName().data() ); 425 fileL.sprintf( "%s",fi->fileName().data() );
425 fileDate= fi->lastModified().toString(); 426 fileDate= fi->lastModified().toString();
426 if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) { 427 if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) {
427 fileL+="/"; 428 fileL+="/";
428 isDir=TRUE; 429 isDir=TRUE;
429// qDebug( fileL); 430// qDebug( fileL);
430 } 431 }
431 } 432 }
432 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL); 433 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL);
433 if(fileL !="./" && fi->exists()) { 434 if(fileL !="./" && fi->exists()) {
434 item= new QListViewItem( Remote_View, fileL, fileS, fileDate); 435 item= new QListViewItem( Remote_View, fileL, fileS, fileDate);
435 QPixmap pm; 436 QPixmap pm;
436 437
437 if(isDir || fileL.find("/",0,TRUE) != -1) { 438 if(isDir || fileL.find("/",0,TRUE) != -1) {
438 if( !QDir( fi->filePath() ).isReadable()) 439 if( !QDir( fi->filePath() ).isReadable())
439 pm = Resource::loadPixmap( "lockedfolder" ); 440 pm = Resource::loadPixmap( "lockedfolder" );
440 else 441 else
441 pm= Resource::loadPixmap( "folder" ); 442 pm= Resource::loadPixmap( "folder" );
442// item->setPixmap( 0,pm ); 443// item->setPixmap( 0,pm );
443 } else if( (fileInfo.permission( QFileInfo::ExeUser) 444 } else if( (fileInfo.permission( QFileInfo::ExeUser)
444 | fileInfo.permission( QFileInfo::ExeGroup) 445 | fileInfo.permission( QFileInfo::ExeGroup)
445 | fileInfo.permission( QFileInfo::ExeOther)) & fs.find("vfat",0,TRUE) == -1) { 446 | fileInfo.permission( QFileInfo::ExeOther))
447 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
446///// } else if(fileInfo.isExecutable()){ //is exec <<<< BROKEN!! 448///// } else if(fileInfo.isExecutable()){ //is exec <<<< BROKEN!!
447 pm = Resource::loadPixmap( "exec"); 449 pm = Resource::loadPixmap( "exec");
448// item->setPixmap( 0,pm); 450// item->setPixmap( 0,pm);
449 } else if( !fi->isReadable() ) { 451 } else if( !fi->isReadable() ) {
450 pm = Resource::loadPixmap( "locked" ); 452 pm = Resource::loadPixmap( "locked" );
451// item->setPixmap( 0,pm); 453// item->setPixmap( 0,pm);
452 } else { 454 } else {
453 MimeType mt(fi->filePath()); 455 MimeType mt(fi->filePath());
454 pm=mt.pixmap(); //sets the correct pixmap for mimetype 456 pm=mt.pixmap(); //sets the correct pixmap for mimetype
455 if(pm.isNull()) 457 if(pm.isNull())
456 pm = Resource::loadPixmap( "UnknownDocument-14" ); 458 pm = Resource::loadPixmap( "UnknownDocument-14" );
457// item->setPixmap( 0,pm); 459// item->setPixmap( 0,pm);
458 } 460 }
459 if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) { 461 if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) {
460 // overlay link image 462 // overlay link image
461 pm= Resource::loadPixmap( "folder" ); 463 pm= Resource::loadPixmap( "folder" );
462 QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 464 QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
463 QPainter painter( &pm ); 465 QPainter painter( &pm );
464 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 466 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
465 pm.setMask( pm.createHeuristicMask( FALSE ) ); 467 pm.setMask( pm.createHeuristicMask( FALSE ) );
466// item->setPixmap( 0, pm); 468// item->setPixmap( 0, pm);
467 } 469 }
468 item->setPixmap( 0, pm); 470 item->setPixmap( 0, pm);
469 } 471 }
470 isDir=FALSE; 472 isDir=FALSE;
471 ++it; 473 ++it;
472 } 474 }
473 475
474 if(currentRemoteDir.canonicalPath().find("dev",0,TRUE) != -1) { 476 if(currentRemoteDir.canonicalPath().find("dev",0,TRUE) != -1) {
475 struct stat buf; 477 struct stat buf;
476// struct stat st; 478// struct stat st;
477// mode_t mode; 479// mode_t mode;