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

Method improveFilenames

src/pdiff.cpp:1479–1507  ·  view source on GitHub ↗

If A is targetted to an existing file and the paths point to directories attempt to find that file in the corresponding directory. If it exists then the filename from A will be appended to the path. */

Source from the content-addressed store, hash-verified

1477 directory. If it exists then the filename from A will be appended to the path.
1478*/
1479void KDiff3App::improveFilenames()
1480{
1481 FileAccess f1(m_sd1->getFilename());
1482 FileAccess f2(m_sd2->getFilename());
1483 FileAccess f3(m_sd3->getFilename());
1484 FileAccess f4(m_outputFilename);
1485
1486 if(f1.isFile() && f1.exists())
1487 {
1488 if(f2.isDir())
1489 {
1490 f2.addPath(f1.fileName());
1491 if(f2.isFile() && f2.exists())
1492 m_sd2->setFileAccess(f2);
1493 }
1494 if(f3.isDir())
1495 {
1496 f3.addPath(f1.fileName());
1497 if(f3.isFile() && f3.exists())
1498 m_sd3->setFileAccess(f3);
1499 }
1500 if(f4.isDir())
1501 {
1502 f4.addPath(f1.fileName());
1503 if(f4.isFile() && f4.exists())
1504 m_outputFilename = f4.absoluteFilePath();
1505 }
1506 }
1507}
1508
1509void KDiff3App::slotReload()
1510{

Callers

nothing calls this directly

Calls 8

getFilenameMethod · 0.80
fileNameMethod · 0.80
isFileMethod · 0.45
existsMethod · 0.45
isDirMethod · 0.45
addPathMethod · 0.45
setFileAccessMethod · 0.45
absoluteFilePathMethod · 0.45

Tested by

no test coverage detected