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

Method showStatusLine

src/difftextwindow.cpp:649–670  ·  view source on GitHub ↗

Takes the line number estimated from mouse position and converts it to the actual line in the file. Then sets the status message accordingly. emits lineClicked signal. */

Source from the content-addressed store, hash-verified

647 emits lineClicked signal.
648*/
649void DiffTextWindow::showStatusLine(const LineRef lineFromPos)
650{
651 LineType d3lIdx = convertLineToDiff3LineIdx(lineFromPos);
652
653 if(d->getDiff3LineVector() != nullptr && d3lIdx >= 0 && d3lIdx < (qint32)d->getDiff3LineVector()->size())
654 {
655 const Diff3Line* pD3l = (*d->getDiff3LineVector())[d3lIdx];
656 if(pD3l != nullptr)
657 {
658 LineRef actualLine = pD3l->getLineInFile(getWindowIndex());
659
660 QString message;
661 if(actualLine.isValid())
662 message = i18n("File %1: Line %2", getFileName(), actualLine + 1);
663 else
664 message = i18n("File %1: Line not available", getFileName());
665 Q_EMIT statusBarMessage(message);
666
667 Q_EMIT lineClicked(getWindowIndex(), actualLine);
668 }
669 }
670}
671
672void DiffTextWindow::scrollVertically(qint32 deltaY)
673{

Callers

nothing calls this directly

Calls 4

getLineInFileMethod · 0.80
getDiff3LineVectorMethod · 0.45
sizeMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected