Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 80324eb..ed280aa 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -611,105 +611,119 @@ void AdvancedFm::runCommand() { | |||
611 | 611 | ||
612 | QString curFile; | 612 | QString curFile; |
613 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); | 613 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); |
614 | 614 | ||
615 | InputDialog *fileDlg; | 615 | InputDialog *fileDlg; |
616 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 616 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
617 | fileDlg->setInputText(curFile); | 617 | fileDlg->setInputText(curFile); |
618 | fileDlg->exec(); | 618 | fileDlg->exec(); |
619 | //QString command; | 619 | //QString command; |
620 | 620 | ||
621 | if( fileDlg->result() == 1 ) { | 621 | if( fileDlg->result() == 1 ) { |
622 | // odebug << fileDlg->LineEdit1->text() << oendl; | 622 | // odebug << fileDlg->LineEdit1->text() << oendl; |
623 | QStringList command; | 623 | QStringList command; |
624 | 624 | ||
625 | command << "/bin/sh"; | 625 | command << "/bin/sh"; |
626 | command << "-c"; | 626 | command << "-c"; |
627 | command << fileDlg->LineEdit1->text(); | 627 | command << fileDlg->LineEdit1->text(); |
628 | Output *outDlg; | 628 | Output *outDlg; |
629 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 629 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
630 | QPEApplication::execDialog( outDlg ); | 630 | QPEApplication::execDialog( outDlg ); |
631 | qApp->processEvents(); | 631 | qApp->processEvents(); |
632 | 632 | ||
633 | } | 633 | } |
634 | } | 634 | } |
635 | 635 | ||
636 | void AdvancedFm::runCommandStd() { | 636 | void AdvancedFm::runCommandStd() { |
637 | if( !CurrentView()->currentItem()) return; | 637 | if( !CurrentView()->currentItem()) return; |
638 | QString curFile; | 638 | QString curFile; |
639 | QDir *thisDir = CurrentDir(); | 639 | QDir *thisDir = CurrentDir(); |
640 | QListView *thisView = CurrentView(); | 640 | QListView *thisView = CurrentView(); |
641 | if( thisView->currentItem()) | 641 | if( thisView->currentItem()) |
642 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); | 642 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); |
643 | 643 | ||
644 | InputDialog *fileDlg; | 644 | InputDialog *fileDlg; |
645 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 645 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
646 | fileDlg->setInputText(curFile); | 646 | fileDlg->setInputText(curFile); |
647 | fileDlg->exec(); | 647 | fileDlg->exec(); |
648 | 648 | ||
649 | if( fileDlg->result() == 1 ) { | 649 | if( fileDlg->result() == 1 ) { |
650 | qApp->processEvents(); | 650 | qApp->processEvents(); |
651 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); | 651 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); |
652 | } | 652 | } |
653 | } | 653 | } |
654 | 654 | ||
655 | void AdvancedFm::fileStatus() { | 655 | void AdvancedFm::fileStatus() { |
656 | if( !CurrentView()->currentItem()) return; | 656 | if( !CurrentView()->currentItem()) return; |
657 | QString curFile; | 657 | QString curFile; |
658 | curFile = CurrentView()->currentItem()->text(0); | 658 | curFile = CurrentView()->currentItem()->text(0); |
659 | 659 | if(QFileInfo("/usr/bin/stat").exists()) { | |
660 | QStringList command; | 660 | QStringList command; |
661 | command << "/bin/sh"; | 661 | command << "/bin/sh"; |
662 | command << "-c"; | 662 | command << "-c"; |
663 | command << "stat -l "+ curFile; | 663 | command << "stat -l "+ curFile; |
664 | |||
665 | Output *outDlg; | 664 | Output *outDlg; |
666 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 665 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
667 | QPEApplication::execDialog( outDlg ); | 666 | QPEApplication::execDialog( outDlg ); |
667 | } else { | ||
668 | /* struct stat buf; | ||
669 | stat( curFile.local8bit(), &buf); | ||
670 | |||
671 | st_dev dev; | ||
672 | st_uid uid; | ||
673 | st_gid gid; | ||
674 | st_size size; | ||
675 | st_atime atime; | ||
676 | st_mtime mtime; | ||
677 | st_ctime ctime; | ||
678 | st_mode mode; | ||
679 | */ | ||
680 | } | ||
681 | |||
668 | qApp->processEvents(); | 682 | qApp->processEvents(); |
669 | } | 683 | } |
670 | 684 | ||
671 | 685 | ||
672 | void AdvancedFm::mkDir() { | 686 | void AdvancedFm::mkDir() { |
673 | makeDir(); | 687 | makeDir(); |
674 | } | 688 | } |
675 | 689 | ||
676 | void AdvancedFm::rn() { | 690 | void AdvancedFm::rn() { |
677 | renameIt(); | 691 | renameIt(); |
678 | } | 692 | } |
679 | 693 | ||
680 | void AdvancedFm::del() { | 694 | void AdvancedFm::del() { |
681 | doDelete(); | 695 | doDelete(); |
682 | } | 696 | } |
683 | 697 | ||
684 | void AdvancedFm::mkSym() { | 698 | void AdvancedFm::mkSym() { |
685 | QString cmd; | 699 | QString cmd; |
686 | QStringList curFileList = getPath(); | 700 | QStringList curFileList = getPath(); |
687 | if( curFileList.count() > 0) { | 701 | if( curFileList.count() > 0) { |
688 | QDir *thisDir = CurrentDir(); | 702 | QDir *thisDir = CurrentDir(); |
689 | QDir * thatDir = OtherDir(); | 703 | QDir * thatDir = OtherDir(); |
690 | 704 | ||
691 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 705 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
692 | 706 | ||
693 | QString destName = thatDir->canonicalPath()+"/"+(*it); | 707 | QString destName = thatDir->canonicalPath()+"/"+(*it); |
694 | if(destName.right(1) == "/") { | 708 | if(destName.right(1) == "/") { |
695 | destName = destName.left( destName.length() -1); | 709 | destName = destName.left( destName.length() -1); |
696 | } | 710 | } |
697 | 711 | ||
698 | QString curFile = thisDir->canonicalPath()+"/"+(*it); | 712 | QString curFile = thisDir->canonicalPath()+"/"+(*it); |
699 | 713 | ||
700 | if( curFile.right(1) == "/") { | 714 | if( curFile.right(1) == "/") { |
701 | curFile = curFile.left( curFile.length() -1); | 715 | curFile = curFile.left( curFile.length() -1); |
702 | } | 716 | } |
703 | 717 | ||
704 | cmd = "ln -s "+curFile+" "+destName; | 718 | cmd = "ln -s "+curFile+" "+destName; |
705 | // odebug << cmd << oendl; | 719 | // odebug << cmd << oendl; |
706 | startProcess( (const QString)cmd ); | 720 | startProcess( (const QString)cmd ); |
707 | } | 721 | } |
708 | rePopulate(); | 722 | rePopulate(); |
709 | setOtherTabCurrent(); | 723 | setOtherTabCurrent(); |
710 | } | 724 | } |
711 | } | 725 | } |
712 | 726 | ||
713 | void AdvancedFm::doBeam() { | 727 | void AdvancedFm::doBeam() { |
714 | Ir ir; | 728 | Ir ir; |
715 | if(!ir.supported()) { | 729 | if(!ir.supported()) { |