Return true for success, else false
| 1413 | |
| 1414 | /// Return true for success, else false |
| 1415 | bool KDiff3App::doDirectoryCompare(const bool bCreateNewInstance) |
| 1416 | { |
| 1417 | FileAccess f1(m_sd1->getFilename()); |
| 1418 | FileAccess f2(m_sd2->getFilename()); |
| 1419 | FileAccess f3(m_sd3->getFilename()); |
| 1420 | FileAccess f4(m_outputFilename); |
| 1421 | |
| 1422 | assert(f1.isDir()); |
| 1423 | |
| 1424 | if(bCreateNewInstance) |
| 1425 | { |
| 1426 | Q_EMIT createNewInstance(f1.absoluteFilePath(), f2.absoluteFilePath(), f3.absoluteFilePath()); |
| 1427 | } |
| 1428 | else |
| 1429 | { |
| 1430 | //Only a debugging aid now. Used to insure m_bDirCompare is not changed |
| 1431 | [[maybe_unused]] const bool bDirCompare = m_bDirCompare; |
| 1432 | |
| 1433 | FileAccess destDir; |
| 1434 | |
| 1435 | if(!m_bDefaultFilename) destDir = f4; |
| 1436 | m_pDirectoryMergeDock->show(); |
| 1437 | m_pDirectoryMergeInfoDock->show(); |
| 1438 | m_pMainWidget->hide(); |
| 1439 | setUpdatesEnabled(true); |
| 1440 | |
| 1441 | (*gDirInfo) = DirectoryInfo(f1, f2, f3, destDir); |
| 1442 | |
| 1443 | bool bSuccess = m_pDirectoryMergeWindow->init( |
| 1444 | !m_outputFilename.isEmpty()); |
| 1445 | //This is a bug if it still happens. |
| 1446 | assert(m_bDirCompare == bDirCompare); |
| 1447 | |
| 1448 | if(bSuccess) |
| 1449 | { |
| 1450 | m_sd1->reset(); |
| 1451 | if(m_pDiffTextWindow1 != nullptr) |
| 1452 | { |
| 1453 | m_pDiffTextWindow1->init(QString(""), nullptr, eLineEndStyleDos, nullptr, 0, nullptr, nullptr); |
| 1454 | m_pDiffTextWindowFrame1->init(); |
| 1455 | } |
| 1456 | m_sd2->reset(); |
| 1457 | if(m_pDiffTextWindow2 != nullptr) |
| 1458 | { |
| 1459 | m_pDiffTextWindow2->init(QString(""), nullptr, eLineEndStyleDos, nullptr, 0, nullptr, nullptr); |
| 1460 | m_pDiffTextWindowFrame2->init(); |
| 1461 | } |
| 1462 | m_sd3->reset(); |
| 1463 | if(m_pDiffTextWindow3 != nullptr) |
| 1464 | { |
| 1465 | m_pDiffTextWindow3->init(QString(""), nullptr, eLineEndStyleDos, nullptr, 0, nullptr, nullptr); |
| 1466 | m_pDiffTextWindowFrame3->init(); |
| 1467 | } |
| 1468 | } |
| 1469 | Q_EMIT updateAvailabilities(); |
| 1470 | return bSuccess; |
| 1471 | } |
| 1472 |
nothing calls this directly
no test coverage detected