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

Method appendRow

kdevplatform/project/projectmodel.cpp:400–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400void ProjectBaseItem::appendRow( ProjectBaseItem* item )
401{
402 Q_D(ProjectBaseItem);
403 if( !item ) {
404 return;
405 }
406 if( item->parent() ) {
407 // Proper way is to first removeRow() on the original parent, then appendRow on this one
408 qCWarning(PROJECT) << "Ignoring double insertion of item" << item;
409 return;
410 }
411 // this is too slow... O(n) and thankfully not a problem anyways
412// Q_ASSERT(!d->children.contains(item));
413 int startrow,endrow;
414 if( model() ) {
415 startrow = endrow = d->children.count();
416 model()->beginInsertRows(index(), startrow, endrow);
417 }
418 d->children.append( item );
419 item->setRow( d->children.count() - 1 );
420 item->d_func()->parent = this;
421 item->setModel( model() );
422 if( model() ) {
423 model()->endInsertRows();
424 }
425}
426
427Path ProjectBaseItem::path() const
428{

Callers 15

reloadDoneMethod · 0.80
importDoneMethod · 0.80
newModelMethod · 0.80
renameMethod · 0.80
ProjectBaseItemMethod · 0.80
testCreateTargetItemsMethod · 0.80
testItemSanityMethod · 0.80
testTakeRowMethod · 0.80
testItemsForPathMethod · 0.80

Calls 8

modelFunction · 0.85
setRowMethod · 0.80
d_funcMethod · 0.80
indexFunction · 0.50
parentMethod · 0.45
countMethod · 0.45
appendMethod · 0.45
setModelMethod · 0.45

Tested by 15

newModelMethod · 0.64
testCreateTargetItemsMethod · 0.64
testItemSanityMethod · 0.64
testTakeRowMethod · 0.64
testItemsForPathMethod · 0.64
testProjectProxyModelMethod · 0.64
initMethod · 0.64
addBigTreeMethod · 0.64
addItemDelayedMethod · 0.64