| 720 | } |
| 721 | |
| 722 | void KDiff3App::slotFileOpen() |
| 723 | { |
| 724 | if(!canContinue()) return; |
| 725 | |
| 726 | if(m_pDirectoryMergeWindow->isDirectoryMergeInProgress()) |
| 727 | { |
| 728 | qint32 result = Compat::warningTwoActions(this, |
| 729 | i18n("You are currently doing a folder merge. Are you sure, you want to abort?"), |
| 730 | i18nc("Error dialog title", "Warning"), |
| 731 | KGuiItem(i18n("Abort")), |
| 732 | KGuiItem(i18n("Continue Merging"))); |
| 733 | if(result != Compat::PrimaryAction) |
| 734 | return; |
| 735 | } |
| 736 | |
| 737 | slotStatusMsg(i18n("Opening files...")); |
| 738 | |
| 739 | for(;;) |
| 740 | { |
| 741 | QPointer<OpenDialog> d = QPointer<OpenDialog>(new OpenDialog(this, |
| 742 | QDir::toNativeSeparators(m_bDirCompare ? gDirInfo->dirA().prettyAbsPath() : m_sd1->isFromBuffer() ? QString("") : |
| 743 | m_sd1->getAliasName()), |
| 744 | QDir::toNativeSeparators(m_bDirCompare ? gDirInfo->dirB().prettyAbsPath() : m_sd2->isFromBuffer() ? QString("") : |
| 745 | m_sd2->getAliasName()), |
| 746 | QDir::toNativeSeparators(m_bDirCompare ? gDirInfo->dirC().prettyAbsPath() : m_sd3->isFromBuffer() ? QString("") : |
| 747 | m_sd3->getAliasName()), |
| 748 | m_bDirCompare ? !gDirInfo->destDir().prettyAbsPath().isEmpty() : !m_outputFilename.isEmpty(), |
| 749 | QDir::toNativeSeparators(m_bDefaultFilename ? QString("") : m_outputFilename))); |
| 750 | |
| 751 | qint32 status = d->exec(); |
| 752 | if(status == QDialog::Accepted) |
| 753 | { |
| 754 | m_sd1->setFilename(d->getFileA()); |
| 755 | m_sd2->setFilename(d->getFileB()); |
| 756 | m_sd3->setFilename(d->getFileC()); |
| 757 | |
| 758 | if(d->merge()) |
| 759 | { |
| 760 | if(d->getOutputFile().isEmpty()) |
| 761 | { |
| 762 | m_outputFilename = "unnamed.txt"; |
| 763 | m_bDefaultFilename = true; |
| 764 | } |
| 765 | else |
| 766 | { |
| 767 | m_outputFilename = d->getOutputFile(); |
| 768 | m_bDefaultFilename = false; |
| 769 | } |
| 770 | } |
| 771 | else |
| 772 | m_outputFilename = ""; |
| 773 | |
| 774 | m_bDirCompare = m_sd1->isDir(); |
| 775 | |
| 776 | if(m_bDirCompare) |
| 777 | { |
| 778 | bool bSuccess = doDirectoryCompare(false); |
| 779 | if(bSuccess) |
nothing calls this directly
no test coverage detected