MCPcopy Create free account
hub / github.com/KDE/kdiff3 / completeInit

Method completeInit

src/kdiff3.cpp:613–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613void KDiff3App::completeInit()
614{
615 bool openError = false;
616 bool bSuccess = true;
617
618 //Should not fail ever.
619 assert(m_bDirCompare == m_sd1->isDir());
620 if(m_bDirCompare != m_sd2->isDir() || (!m_sd3->isEmpty() && m_bDirCompare != m_sd3->isDir()))
621 {
622 KMessageBox::error(this, i18nc("Error message", "Can't compare file with folder."),
623 i18nc("Title error message box", "Bad comparison attempt"));
624
625 bSuccess = false;
626 m_bDirCompare = false;
627 openError = true;
628 }
629
630 if(m_bAutoFlag && m_bAutoMode && m_bDirCompare)
631 {
632 QTextStream(stderr) << i18n("Option --auto ignored for folder comparison.") << "\n";
633 m_bAutoMode = false;
634 }
635
636 if(!m_bAutoMode)
637 showMainWindow();
638
639 g_pProgressDialog->setStayHidden(false);
640
641 if(bSuccess)
642 {
643 if(m_bDirCompare)
644 bSuccess = doDirectoryCompare(false);
645 else
646 {
647 doFileCompare();
648 if(m_totalDiffStatus->getUnsolvedConflicts() != 0)
649 bSuccess = false;
650
651 if(m_bAutoMode && m_totalDiffStatus->getUnsolvedConflicts() == 0)
652 {
653 QSharedPointer<SourceData> pSD = nullptr;
654 if(m_sd3->isEmpty())
655 {
656 if(m_totalDiffStatus->isBinaryEqualAB())
657 {
658 pSD = m_sd1;
659 }
660 }
661 else
662 {
663 if(m_totalDiffStatus->isBinaryEqualBC() || m_totalDiffStatus->isBinaryEqualAB())
664 {
665 //if B==C (assume A is old), if A==B then C has changed
666 pSD = m_sd3;
667 }
668 else if(m_totalDiffStatus->isBinaryEqualAC())
669 {
670 pSD = m_sd2; // assuming B has changed

Callers 1

KDiff3ShellMethod · 0.80

Calls 15

QTextStreamClass · 0.85
setStayHiddenMethod · 0.80
getUnsolvedConflictsMethod · 0.80
isBinaryEqualABMethod · 0.80
isBinaryEqualBCMethod · 0.80
isBinaryEqualACMethod · 0.80
createBackupMethod · 0.80
saveNormalDataAsMethod · 0.80
saveDocumentMethod · 0.80
slotClipboardChangedMethod · 0.80
getAliasNameMethod · 0.80

Tested by

no test coverage detected