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

Method lessThan

kdevplatform/project/projectmodel.cpp:369–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369bool ProjectBaseItem::lessThan( const KDevelop::ProjectBaseItem* item ) const
370{
371 if(item->type() >= KDevelop::ProjectBaseItem::CustomProjectItemType ) {
372 // For custom types we want to make sure that if they override lessThan, then we
373 // prefer their lessThan implementation
374 return !item->lessThan( this );
375 }
376 KDevelop::ProjectBaseItem::ProjectItemType leftType=baseType(type()), rightType=baseType(item->type());
377 if(leftType==rightType)
378 {
379 return text().compare(item->text(), Qt::CaseInsensitive) < 0;
380 }
381 else
382 {
383 return leftType<rightType;
384 }
385
386 return false;
387}
388
389bool ProjectBaseItem::pathLessThan(ProjectBaseItem* item1, ProjectBaseItem* item2)
390{

Callers 1

testItemSanityMethod · 0.45

Calls 5

baseTypeFunction · 0.85
typeFunction · 0.50
typeMethod · 0.45
compareMethod · 0.45
textMethod · 0.45

Tested by 1

testItemSanityMethod · 0.36