author | llornkcor <llornkcor> | 2002-11-15 14:24:58 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-15 14:24:58 (UTC) |
commit | 05f56fbbbe9ea5546f7503f4852fcab9c5b10a00 (patch) (unidiff) | |
tree | bcc91dc6fd97e828f6dead6cb5811e84b2bb0154 | |
parent | b35750b8fe75e055e014e0dd294c714976f5715f (diff) | |
download | opie-05f56fbbbe9ea5546f7503f4852fcab9c5b10a00.zip opie-05f56fbbbe9ea5546f7503f4852fcab9c5b10a00.tar.gz opie-05f56fbbbe9ea5546f7503f4852fcab9c5b10a00.tar.bz2 |
dang it. small fix
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index bef701a..f89ad30 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -504,108 +504,110 @@ void AdvancedFm::copy() { | |||
504 | curFile = currentRemoteDir.canonicalPath()+"/"+ item;; | 504 | curFile = currentRemoteDir.canonicalPath()+"/"+ item;; |
505 | qDebug("CurrentFile file is " + curFile); | 505 | qDebug("CurrentFile file is " + curFile); |
506 | 506 | ||
507 | QFile f(destFile); | 507 | QFile f(destFile); |
508 | if( f.exists()) { | 508 | if( f.exists()) { |
509 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 509 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
510 | item+tr("\nexists. Ok to overwrite?"), | 510 | item+tr("\nexists. Ok to overwrite?"), |
511 | tr("Yes"),tr("No"),0,0,1) ) { | 511 | tr("Yes"),tr("No"),0,0,1) ) { |
512 | case 1: | 512 | case 1: |
513 | return; | 513 | return; |
514 | break; | 514 | break; |
515 | }; | 515 | }; |
516 | f.remove(); | 516 | f.remove(); |
517 | } | 517 | } |
518 | if(!copyFile(destFile, curFile) ) { | 518 | if(!copyFile(destFile, curFile) ) { |
519 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 519 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
520 | +curFile +tr("to\n")+destFile); | 520 | +curFile +tr("to\n")+destFile); |
521 | return; | 521 | return; |
522 | 522 | ||
523 | } | 523 | } |
524 | } | 524 | } |
525 | populateLocalView(); | 525 | populateLocalView(); |
526 | TabWidget->setCurrentTab(0); | 526 | TabWidget->setCurrentTab(0); |
527 | } | 527 | } |
528 | 528 | ||
529 | } | 529 | } |
530 | } | 530 | } |
531 | 531 | ||
532 | void AdvancedFm::copyAs() { | 532 | void AdvancedFm::copyAs() { |
533 | qApp->processEvents(); | 533 | qApp->processEvents(); |
534 | 534 | ||
535 | QStringList curFileList = getPath(); | 535 | QStringList curFileList = getPath(); |
536 | QString curFile; | 536 | QString curFile, item; |
537 | InputDialog *fileDlg; | 537 | InputDialog *fileDlg; |
538 | if (TabWidget->getCurrentTab() == 0) { | 538 | if (TabWidget->getCurrentTab() == 0) { |
539 | qDebug("tab 1"); | 539 | qDebug("tab 1"); |
540 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 540 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
541 | QString destFile; | 541 | QString destFile; |
542 | item=(*it); | ||
542 | curFile = currentDir.canonicalPath()+"/"+(*it); | 543 | curFile = currentDir.canonicalPath()+"/"+(*it); |
543 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); | 544 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); |
544 | 545 | ||
545 | fileDlg->setInputText((const QString &) destFile ); | 546 | fileDlg->setInputText((const QString &) destFile ); |
546 | fileDlg->exec(); | 547 | fileDlg->exec(); |
547 | 548 | ||
548 | if( fileDlg->result() == 1 ) { | 549 | if( fileDlg->result() == 1 ) { |
549 | QString filename = fileDlg->LineEdit1->text(); | 550 | QString filename = fileDlg->LineEdit1->text(); |
550 | destFile = currentRemoteDir.canonicalPath()+"/"+filename; | 551 | destFile = currentRemoteDir.canonicalPath()+"/"+filename; |
551 | 552 | ||
552 | QFile f(destFile); | 553 | QFile f(destFile); |
553 | if( f.exists()) { | 554 | if( f.exists()) { |
554 | switch (QMessageBox::warning(this,tr("File Exists!"), | 555 | switch (QMessageBox::warning(this,tr("File Exists!"), |
555 | item+tr("\nexists. Ok to overwrite?"), | 556 | item+tr("\nexists. Ok to overwrite?"), |
556 | tr("Yes"),tr("No"),0,0,1) ) { | 557 | tr("Yes"),tr("No"),0,0,1) ) { |
557 | case 0: | 558 | case 0: |
558 | f.remove(); | 559 | f.remove(); |
559 | break; | 560 | break; |
560 | case 1: | 561 | case 1: |
561 | return; | 562 | return; |
562 | break; | 563 | break; |
563 | }; | 564 | }; |
564 | } | 565 | } |
565 | if(!copyFile(destFile, curFile) ) { | 566 | if(!copyFile(destFile, curFile) ) { |
566 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 567 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
567 | +curFile +tr("to\n")+destFile); | 568 | +curFile +tr("to\n")+destFile); |
568 | return; | 569 | return; |
569 | } | 570 | } |
570 | } | 571 | } |
571 | delete fileDlg; | 572 | delete fileDlg; |
572 | 573 | ||
573 | } | 574 | } |
574 | populateRemoteView(); | 575 | populateRemoteView(); |
575 | TabWidget->setCurrentTab(1); | 576 | TabWidget->setCurrentTab(1); |
576 | 577 | ||
577 | } else { | 578 | } else { |
578 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 579 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
579 | 580 | ||
581 | item=(*it); | ||
580 | curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | 582 | curFile = currentRemoteDir.canonicalPath()+"/"+(*it); |
581 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); | 583 | fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); |
582 | 584 | ||
583 | QString destFile; | 585 | QString destFile; |
584 | fileDlg->setInputText((const QString &) destFile); | 586 | fileDlg->setInputText((const QString &) destFile); |
585 | fileDlg->exec(); | 587 | fileDlg->exec(); |
586 | 588 | ||
587 | if( fileDlg->result() == 1 ) { | 589 | if( fileDlg->result() == 1 ) { |
588 | QString filename = fileDlg->LineEdit1->text(); | 590 | QString filename = fileDlg->LineEdit1->text(); |
589 | destFile = currentDir.canonicalPath()+"/"+filename; | 591 | destFile = currentDir.canonicalPath()+"/"+filename; |
590 | 592 | ||
591 | QFile f( destFile); | 593 | QFile f( destFile); |
592 | if( f.exists()) { | 594 | if( f.exists()) { |
593 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 595 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
594 | item+tr("\nexists. Ok to overwrite?"), | 596 | item+tr("\nexists. Ok to overwrite?"), |
595 | tr("Yes"),tr("No"),0,0,1) ) { | 597 | tr("Yes"),tr("No"),0,0,1) ) { |
596 | case 0: | 598 | case 0: |
597 | f.remove(); | 599 | f.remove(); |
598 | break; | 600 | break; |
599 | case 1: | 601 | case 1: |
600 | return; | 602 | return; |
601 | break; | 603 | break; |
602 | }; | 604 | }; |
603 | } | 605 | } |
604 | if(!copyFile(destFile, curFile) ) { | 606 | if(!copyFile(destFile, curFile) ) { |
605 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 607 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
606 | +curFile +tr("to\n")+destFile); | 608 | +curFile +tr("to\n")+destFile); |
607 | return; | 609 | return; |
608 | } | 610 | } |
609 | 611 | ||
610 | } | 612 | } |
611 | delete fileDlg; | 613 | delete fileDlg; |