author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/apps/advancedfm/advancedfmMenu.cpp | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 9ad1146..9e740d0 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -636,122 +636,122 @@ void AdvancedFm::rn() { | |||
636 | } | 636 | } |
637 | 637 | ||
638 | void AdvancedFm::del() { | 638 | void AdvancedFm::del() { |
639 | doDelete(); | 639 | doDelete(); |
640 | } | 640 | } |
641 | 641 | ||
642 | void AdvancedFm::mkSym() { | 642 | void AdvancedFm::mkSym() { |
643 | QString cmd; | 643 | QString cmd; |
644 | QStringList curFileList = getPath(); | 644 | QStringList curFileList = getPath(); |
645 | if( curFileList.count() > 0) { | 645 | if( curFileList.count() > 0) { |
646 | QDir *thisDir = CurrentDir(); | 646 | QDir *thisDir = CurrentDir(); |
647 | QDir * thatDir = OtherDir(); | 647 | QDir * thatDir = OtherDir(); |
648 | 648 | ||
649 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 649 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
650 | 650 | ||
651 | QString destName = thatDir->canonicalPath()+"/"+(*it); | 651 | QString destName = thatDir->canonicalPath()+"/"+(*it); |
652 | if(destName.right(1) == "/") { | 652 | if(destName.right(1) == "/") { |
653 | destName = destName.left( destName.length() -1); | 653 | destName = destName.left( destName.length() -1); |
654 | } | 654 | } |
655 | 655 | ||
656 | QString curFile = thisDir->canonicalPath()+"/"+(*it); | 656 | QString curFile = thisDir->canonicalPath()+"/"+(*it); |
657 | 657 | ||
658 | if( curFile.right(1) == "/") { | 658 | if( curFile.right(1) == "/") { |
659 | curFile = curFile.left( curFile.length() -1); | 659 | curFile = curFile.left( curFile.length() -1); |
660 | } | 660 | } |
661 | 661 | ||
662 | cmd = "ln -s "+curFile+" "+destName; | 662 | cmd = "ln -s "+curFile+" "+destName; |
663 | // qDebug(cmd); | 663 | // qDebug(cmd); |
664 | startProcess( (const QString)cmd ); | 664 | startProcess( (const QString)cmd ); |
665 | } | 665 | } |
666 | rePopulate(); | 666 | rePopulate(); |
667 | setOtherTabCurrent(); | 667 | setOtherTabCurrent(); |
668 | } | 668 | } |
669 | } | 669 | } |
670 | 670 | ||
671 | void AdvancedFm::doBeam() { | 671 | void AdvancedFm::doBeam() { |
672 | Ir ir; | 672 | Ir ir; |
673 | if(!ir.supported()) { | 673 | if(!ir.supported()) { |
674 | } else { | 674 | } else { |
675 | QStringList curFileList = getPath(); | 675 | QStringList curFileList = getPath(); |
676 | if( curFileList.count() > 0) { | 676 | if( curFileList.count() > 0) { |
677 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 677 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
678 | QString curFile = (*it); | 678 | QString curFile = (*it); |
679 | QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; | 679 | QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; |
680 | if( curFilePath.right(1) == "/") { | 680 | if( curFilePath.right(1) == "/") { |
681 | curFilePath = curFilePath.left( curFilePath.length() -1); | 681 | curFilePath = curFilePath.left( curFilePath.length() -1); |
682 | } | 682 | } |
683 | Ir *file = new Ir(this, "IR"); | 683 | Ir *file = new Ir(this, "IR"); |
684 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); | 684 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); |
685 | file->send( curFilePath, curFile ); | 685 | file->send( curFilePath, curFile ); |
686 | } | 686 | } |
687 | } | 687 | } |
688 | } | 688 | } |
689 | } | 689 | } |
690 | 690 | ||
691 | void AdvancedFm::fileBeamFinished( Ir *) { | 691 | void AdvancedFm::fileBeamFinished( Ir *) { |
692 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 692 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
693 | } | 693 | } |
694 | 694 | ||
695 | void AdvancedFm::selectAll() { | 695 | void AdvancedFm::selectAll() { |
696 | QListView *thisView = CurrentView(); | 696 | QListView *thisView = CurrentView(); |
697 | thisView->selectAll(true); | 697 | thisView->selectAll(true); |
698 | thisView->setSelected( thisView->firstChild(),false); | 698 | thisView->setSelected( thisView->firstChild(),false); |
699 | } | 699 | } |
700 | 700 | ||
701 | void AdvancedFm::startProcess(const QString & cmd) { | 701 | void AdvancedFm::startProcess(const QString & cmd) { |
702 | QStringList command; | 702 | QStringList command; |
703 | OProcess *process; | 703 | OProcess *process; |
704 | process = new OProcess(); | 704 | process = new OProcess(); |
705 | connect(process, SIGNAL(processExited(OProcess *)), | 705 | connect(process, SIGNAL(processExited(OProcess*)), |
706 | this, SLOT( processEnded(OProcess *))); | 706 | this, SLOT( processEnded(OProcess*))); |
707 | 707 | ||
708 | connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)), | 708 | connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)), |
709 | this, SLOT( oprocessStderr(OProcess *, char *, int))); | 709 | this, SLOT( oprocessStderr(OProcess*,char*,int))); |
710 | 710 | ||
711 | command << "/bin/sh"; | 711 | command << "/bin/sh"; |
712 | command << "-c"; | 712 | command << "-c"; |
713 | command << cmd.latin1(); | 713 | command << cmd.latin1(); |
714 | *process << command; | 714 | *process << command; |
715 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) | 715 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) |
716 | qDebug("could not start process"); | 716 | qDebug("could not start process"); |
717 | } | 717 | } |
718 | 718 | ||
719 | void AdvancedFm::processEnded(OProcess *) { | 719 | void AdvancedFm::processEnded(OProcess *) { |
720 | rePopulate(); | 720 | rePopulate(); |
721 | } | 721 | } |
722 | 722 | ||
723 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { | 723 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { |
724 | // qWarning("received stderrt %d bytes", buflen); | 724 | // qWarning("received stderrt %d bytes", buflen); |
725 | 725 | ||
726 | QString lineStr = buffer; | 726 | QString lineStr = buffer; |
727 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | 727 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); |
728 | } | 728 | } |
729 | 729 | ||
730 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | 730 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { |
731 | if ( o->inherits( "QLineEdit" ) ) { | 731 | if ( o->inherits( "QLineEdit" ) ) { |
732 | if ( e->type() == QEvent::KeyPress ) { | 732 | if ( e->type() == QEvent::KeyPress ) { |
733 | QKeyEvent *ke = (QKeyEvent*)e; | 733 | QKeyEvent *ke = (QKeyEvent*)e; |
734 | if ( ke->key() == Key_Return || | 734 | if ( ke->key() == Key_Return || |
735 | ke->key() == Key_Enter ) { | 735 | ke->key() == Key_Enter ) { |
736 | okRename(); | 736 | okRename(); |
737 | return true; | 737 | return true; |
738 | } | 738 | } |
739 | else if ( ke->key() == Key_Escape ) { | 739 | else if ( ke->key() == Key_Escape ) { |
740 | cancelRename(); | 740 | cancelRename(); |
741 | return true; | 741 | return true; |
742 | } | 742 | } |
743 | } | 743 | } |
744 | else if ( e->type() == QEvent::FocusOut ) { | 744 | else if ( e->type() == QEvent::FocusOut ) { |
745 | cancelRename(); | 745 | cancelRename(); |
746 | return true; | 746 | return true; |
747 | } | 747 | } |
748 | } | 748 | } |
749 | if ( o->inherits( "QListView" ) ) { | 749 | if ( o->inherits( "QListView" ) ) { |
750 | if ( e->type() == QEvent::FocusIn ) { | 750 | if ( e->type() == QEvent::FocusIn ) { |
751 | if( o == Local_View) { //keep track of which view | 751 | if( o == Local_View) { //keep track of which view |
752 | whichTab=1; | 752 | whichTab=1; |
753 | } | 753 | } |
754 | else { | 754 | else { |
755 | whichTab=2; | 755 | whichTab=2; |
756 | } | 756 | } |
757 | } | 757 | } |