Enable section toggle
This commit is contained in:
@@ -48,6 +48,25 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
|
||||
// wir durchsuchen alle unsere sections nach dem passenden content-type,
|
||||
// hier: content-type beschreibt den projekt-status
|
||||
|
||||
const QString& sectionKey = contentNode->attribute(c_ContentType);
|
||||
if( _sections.hasValidSection( sectionKey ) )
|
||||
{
|
||||
const XQModelSection& section = _sections.sectionByKey( sectionKey );
|
||||
qDebug() << " --- add PROJECT: contentNode: " << contentNode->to_string();
|
||||
|
||||
// __fixme! das ist mist!
|
||||
const XQNodePtr sheetNode = section.sheetRootNode()->first_child();
|
||||
XQItem* newItem = _itemFactory.makeSingleItem( sheetNode, contentNode->attribute( "ProjectName") );
|
||||
|
||||
// den neuen eintrag in die passende section der übersicht eintragen ...
|
||||
section.headerItem().appendRow( newItem );
|
||||
// erzeuger sheet node speichern
|
||||
newItem->setSheetNode( sheetNode );
|
||||
expandNewItem(section.headerItem().index() );
|
||||
return newItem;
|
||||
}
|
||||
|
||||
/*
|
||||
for(const auto& section : _sections )
|
||||
{
|
||||
if( contentNode->attribute(c_ContentType) == section.contentType() )
|
||||
@@ -66,6 +85,7 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode )
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
throw XQException( "addProjectItem: main model should not be empty!" );
|
||||
}
|
||||
|
Reference in New Issue
Block a user