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

Method contextMenuEvent

src/directorymergewindow.cpp:1704–1738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1702
1703#ifndef QT_NO_CONTEXTMENU
1704void DirectoryMergeWindow::contextMenuEvent(QContextMenuEvent* e)
1705{
1706 QModelIndex mi = indexAt(e->pos());
1707 qint32 c = mi.column();
1708
1709 MergeFileInfos* pMFI = d->getMFI(mi);
1710 if(pMFI == nullptr)
1711 return;
1712 if(c == s_ACol || c == s_BCol || c == s_CCol)
1713 {
1714 QString itemPath;
1715 if(c == s_ACol && pMFI->existsInA())
1716 {
1717 itemPath = pMFI->fullNameA();
1718 }
1719 else if(c == s_BCol && pMFI->existsInB())
1720 {
1721 itemPath = pMFI->fullNameB();
1722 }
1723 else if(c == s_CCol && pMFI->existsInC())
1724 {
1725 itemPath = pMFI->fullNameC();
1726 }
1727
1728 if(!itemPath.isEmpty())
1729 {
1730 d->selectItemAndColumn(mi, true);
1731 QMenu m(this);
1732 m.addAction(d->m_pDirCompareExplicit);
1733 m.addAction(d->m_pDirMergeExplicit);
1734
1735 m.popup(e->globalPos());
1736 }
1737 }
1738}
1739#endif
1740
1741QString DirectoryMergeWindow::DirectoryMergeWindowPrivate::getFileName(const QModelIndex& mi) const

Callers

nothing calls this directly

Calls 9

getMFIMethod · 0.80
existsInAMethod · 0.80
fullNameAMethod · 0.80
existsInBMethod · 0.80
fullNameBMethod · 0.80
existsInCMethod · 0.80
fullNameCMethod · 0.80
selectItemAndColumnMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected