Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 828f5a1..cf19ba8 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -451,97 +451,97 @@ void AdvancedFm::showFileMenu() { | |||
451 | } else { | 451 | } else { |
452 | 452 | ||
453 | if (app) | 453 | if (app) |
454 | m->insertItem(app->pixmap(),tr("Open in " + app->name()),this,SLOT(runThis())); | 454 | m->insertItem(app->pixmap(),tr("Open in " + app->name()),this,SLOT(runThis())); |
455 | else if(QFileInfo(fi).isExecutable() ) //damn opie doesnt like this | 455 | else if(QFileInfo(fi).isExecutable() ) //damn opie doesnt like this |
456 | m->insertItem(tr("Execute"),this,SLOT(runThis())); | 456 | m->insertItem(tr("Execute"),this,SLOT(runThis())); |
457 | m->insertItem( Opie::Core::OResource::loadPixmap( "txt", Opie::Core::OResource::SmallIcon ), | 457 | m->insertItem( Opie::Core::OResource::loadPixmap( "txt", Opie::Core::OResource::SmallIcon ), |
458 | tr("Open as text"),this,SLOT(runText())); | 458 | tr("Open as text"),this,SLOT(runText())); |
459 | } | 459 | } |
460 | 460 | ||
461 | m->insertItem(tr("Actions"),n); | 461 | m->insertItem(tr("Actions"),n); |
462 | n->insertItem(tr("Make Directory"),this,SLOT(makeDir())); | 462 | n->insertItem(tr("Make Directory"),this,SLOT(makeDir())); |
463 | 463 | ||
464 | n->insertItem(tr("Make Symlink"),this,SLOT(mkSym())); | 464 | n->insertItem(tr("Make Symlink"),this,SLOT(mkSym())); |
465 | 465 | ||
466 | n->insertSeparator(); | 466 | n->insertSeparator(); |
467 | n->insertItem(tr("Rename"),this,SLOT(renameIt())); | 467 | n->insertItem(tr("Rename"),this,SLOT(renameIt())); |
468 | 468 | ||
469 | n->insertItem(tr("Copy"),this,SLOT(copyTimer())); | 469 | n->insertItem(tr("Copy"),this,SLOT(copyTimer())); |
470 | n->insertItem(tr("Copy As"),this,SLOT(copyAsTimer())); | 470 | n->insertItem(tr("Copy As"),this,SLOT(copyAsTimer())); |
471 | n->insertItem(tr("Copy Same Dir"),this,SLOT(copySameDirTimer())); | 471 | n->insertItem(tr("Copy Same Dir"),this,SLOT(copySameDirTimer())); |
472 | n->insertItem(tr("Move"),this,SLOT(moveTimer())); | 472 | n->insertItem(tr("Move"),this,SLOT(moveTimer())); |
473 | 473 | ||
474 | n->insertSeparator(); | 474 | n->insertSeparator(); |
475 | n->insertItem(tr("Delete"),this,SLOT(doDelete())); | 475 | n->insertItem(tr("Delete"),this,SLOT(doDelete())); |
476 | m->insertItem(tr("Add To Documents"),this,SLOT(addToDocs())); | 476 | m->insertItem(tr("Add To Documents"),this,SLOT(addToDocs())); |
477 | 477 | ||
478 | m->insertItem(tr("Run Command"),this,SLOT(runCommand())); | 478 | m->insertItem(tr("Run Command"),this,SLOT(runCommand())); |
479 | m->insertItem(tr("File Info"),this,SLOT(fileStatus())); | 479 | m->insertItem(tr("File Info"),this,SLOT(fileStatus())); |
480 | 480 | ||
481 | m->insertSeparator(); | 481 | m->insertSeparator(); |
482 | m->insertItem(tr("Set Permissions"),this,SLOT(filePerms())); | 482 | m->insertItem(tr("Set Permissions"),this,SLOT(filePerms())); |
483 | 483 | ||
484 | #if defined(QT_QWS_OPIE) | 484 | #if defined(QT_QWS_OPIE) |
485 | m->insertItem(tr("Properties"),this,SLOT(doProperties())); | 485 | m->insertItem(tr("Properties"),this,SLOT(doProperties())); |
486 | #endif | 486 | #endif |
487 | m->setCheckable(TRUE); | 487 | m->setCheckable(TRUE); |
488 | if (!b) | 488 | if (!b) |
489 | m->setItemChecked(m->idAt(0),TRUE); | 489 | m->setItemChecked(m->idAt(0),TRUE); |
490 | else | 490 | else |
491 | m->setItemChecked(m->idAt(0),FALSE); | 491 | m->setItemChecked(m->idAt(0),FALSE); |
492 | 492 | ||
493 | if(Ir::supported()) | 493 | if(Ir::supported()) |
494 | m->insertItem(tr("Beam File"),this,SLOT(doBeam())); | 494 | m->insertItem(tr("Beam File"),this,SLOT(doBeam())); |
495 | m->setFocus(); | 495 | m->setFocus(); |
496 | 496 | ||
497 | m->exec(QPoint(QCursor::pos().x(),QCursor::pos().y())); | 497 | m->exec(QPoint(QCursor::pos().x(),QCursor::pos().y())); |
498 | 498 | ||
499 | if(m) delete m; | 499 | delete m; |
500 | } | 500 | } |
501 | 501 | ||
502 | 502 | ||
503 | QString AdvancedFm::checkDiskSpace(const QString &path) { | 503 | QString AdvancedFm::checkDiskSpace(const QString &path) { |
504 | struct statfs fss; | 504 | struct statfs fss; |
505 | if ( !statfs( path.latin1(), &fss ) ) { | 505 | if ( !statfs( path.latin1(), &fss ) ) { |
506 | int blkSize = fss.f_bsize; | 506 | int blkSize = fss.f_bsize; |
507 | // int totalBlks = fs.f_blocks; | 507 | // int totalBlks = fs.f_blocks; |
508 | int availBlks = fss.f_bavail; | 508 | int availBlks = fss.f_bavail; |
509 | 509 | ||
510 | long mult = blkSize / 1024; | 510 | long mult = blkSize / 1024; |
511 | long div = 1024 / blkSize; | 511 | long div = 1024 / blkSize; |
512 | if ( !mult ) mult = 1; | 512 | if ( !mult ) mult = 1; |
513 | if ( !div ) div = 1; | 513 | if ( !div ) div = 1; |
514 | 514 | ||
515 | 515 | ||
516 | return QString::number(availBlks * mult / div); | 516 | return QString::number(availBlks * mult / div); |
517 | } | 517 | } |
518 | return ""; | 518 | return ""; |
519 | } | 519 | } |
520 | 520 | ||
521 | void AdvancedFm::addToDocs() { | 521 | void AdvancedFm::addToDocs() { |
522 | QStringList strListPaths = getPath(); | 522 | QStringList strListPaths = getPath(); |
523 | QDir *thisDir = CurrentDir(); | 523 | QDir *thisDir = CurrentDir(); |
524 | 524 | ||
525 | if( strListPaths.count() > 0) { | 525 | if( strListPaths.count() > 0) { |
526 | QString curFile; | 526 | QString curFile; |
527 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { | 527 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { |
528 | curFile = thisDir->canonicalPath()+"/"+(*it); | 528 | curFile = thisDir->canonicalPath()+"/"+(*it); |
529 | // odebug << curFile << oendl; | 529 | // odebug << curFile << oendl; |
530 | QFileInfo fi(curFile); | 530 | QFileInfo fi(curFile); |
531 | DocLnk f; | 531 | DocLnk f; |
532 | // curFile.replace(QRegExp("\\..*"),""); | 532 | // curFile.replace(QRegExp("\\..*"),""); |
533 | f.setName(fi.baseName() ); | 533 | f.setName(fi.baseName() ); |
534 | f.setFile( curFile); | 534 | f.setFile( curFile); |
535 | f.writeLink(); | 535 | f.writeLink(); |
536 | } | 536 | } |
537 | } | 537 | } |
538 | } | 538 | } |
539 | 539 | ||
540 | 540 | ||
541 | void AdvancedFm::customDirsToMenu() { | 541 | void AdvancedFm::customDirsToMenu() { |
542 | 542 | ||
543 | Config cfg("AdvancedFm"); | 543 | Config cfg("AdvancedFm"); |
544 | cfg.setGroup("Menu"); | 544 | cfg.setGroup("Menu"); |
545 | 545 | ||
546 | QStringList list = cfg.readListEntry( "CustomDir", ','); | 546 | QStringList list = cfg.readListEntry( "CustomDir", ','); |
547 | menuButton->insertItems(list ); | 547 | menuButton->insertItems(list ); |