MCPcopy Create free account
hub / github.com/KDE/kdevelop / parent

Method parent

kdevplatform/util/path.cpp:404–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404Path Path::parent() const
405{
406 if (m_data.isEmpty()) {
407 return Path();
408 }
409
410 Path ret(*this);
411 if (m_data.size() == (1 + (isRemote() ? 1 : 0))) {
412 // keep the root item, but clear it, otherwise we'd make the path invalid
413 // or a URL a local path
414 auto& root = ret.m_data.last();
415 if (!isWindowsDriveLetter(root)) {
416 root.clear();
417 }
418 } else {
419 ret.m_data.pop_back();
420 }
421 return ret;
422}
423
424bool Path::hasParent() const
425{

Callers 13

updateStateMethod · 0.45
removeUrlMethod · 0.45
setCurrentIndexMethod · 0.45
masterWidgetFunction · 0.45
insideThisMethod · 0.45
testPathMethod · 0.45
createMethod · 0.45
addRemoveClearSubjobMethod · 0.45
addClearSubjobsMethod · 0.45
finishWrongSubjobMethod · 0.45

Calls 6

isWindowsDriveLetterFunction · 0.85
PathClass · 0.50
isEmptyMethod · 0.45
sizeMethod · 0.45
lastMethod · 0.45
clearMethod · 0.45

Tested by 7

testPathMethod · 0.36
createMethod · 0.36
addRemoveClearSubjobMethod · 0.36
addClearSubjobsMethod · 0.36
finishWrongSubjobMethod · 0.36