summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index f70011b..f1b159c 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -650,113 +650,113 @@ void OpieFtp::doLocalCd()
650void OpieFtp:: doRemoteCd() 650void OpieFtp:: doRemoteCd()
651{ 651{
652 remoteListClicked( Remote_View->currentItem()); 652 remoteListClicked( Remote_View->currentItem());
653 653
654} 654}
655 655
656void OpieFtp::showHidden() 656void OpieFtp::showHidden()
657{ 657{
658 if (!b) { 658 if (!b) {
659 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 659 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
660 localMenu->setItemChecked(localMenu->idAt(0),TRUE); 660 localMenu->setItemChecked(localMenu->idAt(0),TRUE);
661// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 661// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
662 b=TRUE; 662 b=TRUE;
663 663
664 } else { 664 } else {
665 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 665 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
666 localMenu->setItemChecked(localMenu->idAt(0),FALSE); 666 localMenu->setItemChecked(localMenu->idAt(0),FALSE);
667// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 667// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
668 b=FALSE; 668 b=FALSE;
669 } 669 }
670 populateLocalView(); 670 populateLocalView();
671} 671}
672 672
673void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) 673void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
674{ 674{
675 switch (mouse) { 675 switch (mouse) {
676 case 1: 676 case 1:
677 break; 677 break;
678 case 2: 678 case 2:
679 showLocalMenu(item); 679 showLocalMenu(item);
680 break; 680 break;
681 }; 681 };
682} 682}
683 683
684void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) 684void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
685{ 685{
686 switch (mouse) { 686 switch (mouse) {
687 case 1: 687 case 1:
688 break; 688 break;
689 case 2: 689 case 2:
690 showRemoteMenu(item); 690 showRemoteMenu(item);
691 break; 691 break;
692 }; 692 };
693} 693}
694 694
695void OpieFtp::showRemoteMenu(QListViewItem * item) 695void OpieFtp::showRemoteMenu(QListViewItem * item)
696{ 696{
697 QPopupMenu m;// = new QPopupMenu( Local_View ); 697 QPopupMenu m;// = new QPopupMenu( Local_View );
698 if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE)) 698 if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) != -1)
699 m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); 699 m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() ));
700 else 700 else
701 m.insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); 701 m.insertItem( tr( "Download" ), this, SLOT( remoteDownload() ));
702 m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); 702 m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() ));
703 m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); 703 m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
704 m.insertSeparator(); 704 m.insertSeparator();
705 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 705 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
706 m.exec( QCursor::pos() ); 706 m.exec( QCursor::pos() );
707} 707}
708 708
709void OpieFtp::showLocalMenu(QListViewItem * item) 709void OpieFtp::showLocalMenu(QListViewItem * item)
710{ 710{
711 QPopupMenu m; 711 QPopupMenu m;
712 m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 712 m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
713 m.insertSeparator(); 713 m.insertSeparator();
714 if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE)) 714 if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1)
715 m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); 715 m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
716 else 716 else
717 m.insertItem( tr( "Upload" ), this, SLOT( localUpload() )); 717 m.insertItem( tr( "Upload" ), this, SLOT( localUpload() ));
718 m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 718 m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
719 m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); 719 m.insertItem( tr( "Rename" ), this, SLOT( localRename() ));
720 m.insertSeparator(); 720 m.insertSeparator();
721 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 721 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
722 m.setCheckable(TRUE); 722 m.setCheckable(TRUE);
723 if (b) 723 if (b)
724 m.setItemChecked(m.idAt(0),TRUE); 724 m.setItemChecked(m.idAt(0),TRUE);
725 else 725 else
726 m.setItemChecked(m.idAt(0),FALSE); 726 m.setItemChecked(m.idAt(0),FALSE);
727 727
728 m.exec( QCursor::pos() ); 728 m.exec( QCursor::pos() );
729} 729}
730 730
731void OpieFtp::localMakDir() 731void OpieFtp::localMakDir()
732{ 732{
733 InputDialog *fileDlg; 733 InputDialog *fileDlg;
734 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); 734 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0);
735 fileDlg->exec(); 735 fileDlg->exec();
736 if( fileDlg->result() == 1 ) { 736 if( fileDlg->result() == 1 ) {
737 QString filename = fileDlg->LineEdit1->text(); 737 QString filename = fileDlg->LineEdit1->text();
738 currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); 738 currentDir.mkdir( currentDir.canonicalPath()+"/"+filename);
739 } 739 }
740 populateLocalView(); 740 populateLocalView();
741} 741}
742 742
743void OpieFtp::localDelete() 743void OpieFtp::localDelete()
744{ 744{
745 QString f = Local_View->currentItem()->text(0); 745 QString f = Local_View->currentItem()->text(0);
746 if(QDir(f).exists() ) { 746 if(QDir(f).exists() ) {
747 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ 747 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+
748 tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) { 748 tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) {
749 case 0: { 749 case 0: {
750 f=currentDir.canonicalPath()+"/"+f; 750 f=currentDir.canonicalPath()+"/"+f;
751 QString cmd="rmdir "+f; 751 QString cmd="rmdir "+f;
752 system( cmd.latin1()); 752 system( cmd.latin1());
753 populateLocalView(); 753 populateLocalView();
754 } 754 }
755 break; 755 break;
756 case 1: 756 case 1:
757 // exit 757 // exit
758 break; 758 break;
759 }; 759 };
760 760
761 } else { 761 } else {
762 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f 762 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f