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

Method slotJoinDiffs

src/mergeresultwindow.cpp:1328–1371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1326}
1327
1328void MergeResultWindow::slotJoinDiffs(qint32 firstD3lLineIdx, qint32 lastD3lLineIdx)
1329{
1330 MergeBlockList::iterator i;
1331 MergeBlockList::iterator iMBLStart = m_mergeBlockList.end();
1332 MergeBlockList::iterator iMBLEnd = m_mergeBlockList.end();
1333
1334 mUndoRec.reset();
1335 for(i = m_mergeBlockList.begin(); i != m_mergeBlockList.end(); ++i)
1336 {
1337 const MergeBlock& mb = *i;
1338 if(firstD3lLineIdx >= mb.getIndex() && firstD3lLineIdx < mb.getIndex() + mb.sourceRangeLength())
1339 {
1340 iMBLStart = i;
1341 }
1342 if(lastD3lLineIdx >= mb.getIndex() && lastD3lLineIdx < mb.getIndex() + mb.sourceRangeLength())
1343 {
1344 iMBLEnd = i;
1345 ++iMBLEnd;
1346 break;
1347 }
1348 }
1349
1350 bool bJoined = false;
1351 for(i = iMBLStart; i != iMBLEnd && i != m_mergeBlockList.end();)
1352 {
1353 if(i == iMBLStart)
1354 {
1355 ++i;
1356 }
1357 else
1358 {
1359 iMBLStart->join(*i);
1360 i = m_mergeBlockList.erase(i);
1361 bJoined = true;
1362 }
1363 }
1364 if(bJoined)
1365 {
1366 iMBLStart->list().clear();
1367 // Insert a conflict line as placeholder
1368 iMBLStart->list().push_back(MergeEditLine(iMBLStart->id3l()));
1369 }
1370 setFastSelector(iMBLStart);
1371}
1372
1373void MergeResultWindow::myUpdate(qint32 afterMilliSecs)
1374{

Callers

nothing calls this directly

Calls 9

MergeEditLineClass · 0.85
endMethod · 0.80
getIndexMethod · 0.80
sourceRangeLengthMethod · 0.80
joinMethod · 0.80
push_backMethod · 0.80
resetMethod · 0.45
clearMethod · 0.45
id3lMethod · 0.45

Tested by

no test coverage detected