summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index f77554a..a6b59c7 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -593,168 +593,168 @@ void AdvancedFm::copyAs() {
593 item=(*it); 593 item=(*it);
594 curFile = currentRemoteDir.canonicalPath()+"/"+(*it); 594 curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
595 fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); 595 fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0);
596 596
597 QString destFile; 597 QString destFile;
598 fileDlg->setInputText((const QString &) destFile); 598 fileDlg->setInputText((const QString &) destFile);
599 fileDlg->exec(); 599 fileDlg->exec();
600 600
601 if( fileDlg->result() == 1 ) { 601 if( fileDlg->result() == 1 ) {
602 QString filename = fileDlg->LineEdit1->text(); 602 QString filename = fileDlg->LineEdit1->text();
603 destFile = currentDir.canonicalPath()+"/"+filename; 603 destFile = currentDir.canonicalPath()+"/"+filename;
604 604
605 QFile f( destFile); 605 QFile f( destFile);
606 if( f.exists()) { 606 if( f.exists()) {
607 switch ( QMessageBox::warning(this,tr("File Exists!"), 607 switch ( QMessageBox::warning(this,tr("File Exists!"),
608 item+tr("\nexists. Ok to overwrite?"), 608 item+tr("\nexists. Ok to overwrite?"),
609 tr("Yes"),tr("No"),0,0,1) ) { 609 tr("Yes"),tr("No"),0,0,1) ) {
610 case 0: 610 case 0:
611 f.remove(); 611 f.remove();
612 break; 612 break;
613 case 1: 613 case 1:
614 return; 614 return;
615 break; 615 break;
616 }; 616 };
617 } 617 }
618 if(!copyFile( curFile,destFile) ) { 618 if(!copyFile( curFile,destFile) ) {
619 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 619 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
620 +curFile +tr("to\n")+destFile); 620 +curFile +tr("to\n")+destFile);
621 return; 621 return;
622 } 622 }
623 623
624 } 624 }
625 delete fileDlg; 625 delete fileDlg;
626 626
627 } 627 }
628 populateLocalView(); 628 populateLocalView();
629 TabWidget->setCurrentTab(0); 629 TabWidget->setCurrentTab(0);
630 } 630 }
631} 631}
632 632
633void AdvancedFm::copySameDir() { 633void AdvancedFm::copySameDir() {
634 qApp->processEvents(); 634 qApp->processEvents();
635 QStringList curFileList = getPath(); 635 QStringList curFileList = getPath();
636 QString curFile, item, destFile; 636 QString curFile, item, destFile;
637 InputDialog *fileDlg; 637 InputDialog *fileDlg;
638 638
639 if (TabWidget->getCurrentTab() == 0) { 639 if (TabWidget->getCurrentTab() == 0) {
640 640
641 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 641 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
642 item=(*it); 642 item=(*it);
643 curFile = currentDir.canonicalPath()+"/"+ item; 643 curFile = currentDir.canonicalPath()+"/"+ item;
644 644
645 fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); 645 fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0);
646 fileDlg->setInputText((const QString &) destFile ); 646 fileDlg->setInputText((const QString &) destFile );
647 fileDlg->exec(); 647 fileDlg->exec();
648 648
649 if( fileDlg->result() == 1 ) { 649 if( fileDlg->result() == 1 ) {
650 650
651 QString filename = fileDlg->LineEdit1->text(); 651 QString filename = fileDlg->LineEdit1->text();
652 destFile = currentDir.canonicalPath()+"/"+filename; 652 destFile = currentDir.canonicalPath()+"/"+filename;
653 653
654 QFile f(destFile); 654 QFile f(destFile);
655 if( f.exists()) { 655 if( f.exists()) {
656 switch (QMessageBox::warning(this,tr("Delete"), 656 switch (QMessageBox::warning(this,tr("Delete"),
657 destFile+tr(" already exists\nDo you really want to delete it?"), 657 destFile+tr(" already exists.\nDo you really want to delete it?"),
658 tr("Yes"),tr("No"),0,0,1) ) { 658 tr("Yes"),tr("No"),0,0,1) ) {
659 case 0: 659 case 0:
660 660
661 f.remove(); 661 f.remove();
662 break; 662 break;
663 case 1: 663 case 1:
664 return; 664 return;
665 break; 665 break;
666 }; 666 };
667 } 667 }
668 if(!copyFile( curFile,destFile) ) { 668 if(!copyFile( curFile,destFile) ) {
669 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 669 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
670 +curFile +tr("to\n")+destFile); 670 +curFile +tr("to\n")+destFile);
671 return; 671 return;
672 } 672 }
673 673
674 qDebug("copy "+curFile+" as "+destFile); 674 qDebug("copy "+curFile+" as "+destFile);
675 } 675 }
676 delete fileDlg; 676 delete fileDlg;
677 } 677 }
678 populateLocalView(); 678 populateLocalView();
679 679
680 } else { 680 } else {
681 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 681 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
682 item=(*it); 682 item=(*it);
683 curFile = currentRemoteDir.canonicalPath()+"/"+ item; 683 curFile = currentRemoteDir.canonicalPath()+"/"+ item;
684 684
685 fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); 685 fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0);
686 fileDlg->setInputText((const QString &) destFile); 686 fileDlg->setInputText((const QString &) destFile);
687 fileDlg->exec(); 687 fileDlg->exec();
688 if( fileDlg->result() == 1 ) { 688 if( fileDlg->result() == 1 ) {
689 QString filename = fileDlg->LineEdit1->text(); 689 QString filename = fileDlg->LineEdit1->text();
690 690
691 destFile = currentRemoteDir.canonicalPath()+"/"+filename; 691 destFile = currentRemoteDir.canonicalPath()+"/"+filename;
692 692
693 QFile f(destFile); 693 QFile f(destFile);
694 if( f.exists()) { 694 if( f.exists()) {
695 switch ( QMessageBox::warning(this,tr("Delete"), 695 switch ( QMessageBox::warning(this,tr("Delete"),
696 destFile+tr(" already exists\nDo you really want to delete it?"), 696 destFile+tr(" already exists.\nDo you really want to delete it?"),
697 tr("Yes"),tr("No"),0,0,1) ) { 697 tr("Yes"),tr("No"),0,0,1) ) {
698 case 0: 698 case 0:
699 f.remove(); 699 f.remove();
700 break; 700 break;
701 case 1: 701 case 1:
702 return; 702 return;
703 break; 703 break;
704 }; 704 };
705 } 705 }
706 if(!copyFile( curFile,destFile) ) { 706 if(!copyFile( curFile,destFile) ) {
707 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 707 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
708 +curFile +tr("to\n")+destFile); 708 +curFile +tr("to\n")+destFile);
709 return; 709 return;
710 } 710 }
711 qDebug("copy "+curFile+" as "+destFile); 711 qDebug("copy "+curFile+" as "+destFile);
712 } 712 }
713 delete fileDlg; 713 delete fileDlg;
714 } 714 }
715 populateRemoteView(); 715 populateRemoteView();
716 } 716 }
717} 717}
718 718
719void AdvancedFm::move() { 719void AdvancedFm::move() {
720 qApp->processEvents(); 720 qApp->processEvents();
721 721
722 QStringList curFileList = getPath(); 722 QStringList curFileList = getPath();
723 if( curFileList.count() > 0) { 723 if( curFileList.count() > 0) {
724 QString curFile, destFile, item; 724 QString curFile, destFile, item;
725 725
726 if (TabWidget->getCurrentTab() == 0) { 726 if (TabWidget->getCurrentTab() == 0) {
727 727
728 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 728 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
729 item=(*it); 729 item=(*it);
730 QString destFile = currentRemoteDir.canonicalPath(); 730 QString destFile = currentRemoteDir.canonicalPath();
731 731
732 if(destFile.right(1).find("/",0,TRUE) == -1) 732 if(destFile.right(1).find("/",0,TRUE) == -1)
733 destFile+="/"; 733 destFile+="/";
734 destFile += item; 734 destFile += item;
735 curFile = currentDir.canonicalPath(); 735 curFile = currentDir.canonicalPath();
736 736
737 qDebug("Destination file is "+destFile); 737 qDebug("Destination file is "+destFile);
738 738
739 if(curFile.right(1).find("/",0,TRUE) == -1) 739 if(curFile.right(1).find("/",0,TRUE) == -1)
740 curFile +="/"; 740 curFile +="/";
741 741
742 curFile+= item; 742 curFile+= item;
743 qDebug("CurrentFile file is " + curFile); 743 qDebug("CurrentFile file is " + curFile);
744 744
745 QFile f( curFile); 745 QFile f( curFile);
746 if( f.exists()) { 746 if( f.exists()) {
747 if(!copyFile( curFile,destFile) ) { 747 if(!copyFile( curFile,destFile) ) {
748 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); 748 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile);
749 return; 749 return;
750 } else 750 } else
751 QFile::remove(curFile); 751 QFile::remove(curFile);
752 } 752 }
753 } 753 }
754 754
755 TabWidget->setCurrentTab(1); 755 TabWidget->setCurrentTab(1);
756 756
757 } else { //view 2 757 } else { //view 2
758 758
759 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 759 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
760 item = (*it); 760 item = (*it);