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

Method setFastSelector

src/mergeresultwindow.cpp:786–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

784}
785
786void MergeResultWindow::setFastSelector(MergeBlockList::iterator i)
787{
788 if(i == m_mergeBlockList.end())
789 return;
790 m_currentMergeBlockIt = i;
791 Q_EMIT setFastSelectorRange(i->getIndex(), i->sourceRangeLength());
792
793 LineRef line1 = 0;
794
795 MergeBlockList::const_iterator mbIt = m_mergeBlockList.cbegin();
796 for(; mbIt != m_mergeBlockList.cend(); ++mbIt)
797 {
798 if(mbIt == m_currentMergeBlockIt)
799 break;
800 line1 += mbIt->lineCount();
801 }
802
803 LineType nofLines = m_currentMergeBlockIt->lineCount();
804 LineRef newFirstLine = getBestFirstLine(line1, nofLines, m_firstLine, getNofVisibleLines());
805 if(newFirstLine != m_firstLine)
806 {
807 scrollVertically(newFirstLine - m_firstLine);
808 }
809
810 if(m_selection.isEmpty())
811 {
812 m_cursorXPos = 0;
813 m_cursorOldXPixelPos = 0;
814 m_cursorYPos = line1;
815 }
816
817 update();
818 updateSourceMask();
819 Q_EMIT updateAvailabilities();
820}
821
822void MergeResultWindow::choose(const e_SrcSelector selector)
823{

Callers

nothing calls this directly

Calls 6

getBestFirstLineFunction · 0.85
endMethod · 0.80
getIndexMethod · 0.80
sourceRangeLengthMethod · 0.80
lineCountMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected