adding projects to project tree works again.

This commit is contained in:
2025-08-17 11:50:26 +02:00
parent a13a1de8fe
commit 372873717e
9 changed files with 69 additions and 52 deletions

View File

@@ -43,40 +43,36 @@ void XQMainModel::initContextMenu()
//! erzeugt einen eintrag in der baum-übersicht.
XQItem* XQMainModel::createTreeEntry( XQNodePtr contentNode )
XQItem* XQMainModel::makeTreeItem( XQNodePtr contentNode )
{
// wir durchsuchen alle unsere section nach dem passenden content-type,
// hier: content-type beschreibt die
for(const auto& section : _sections )
{
qDebug() << " --- wtf1: " << contentNode->to_string();
qDebug() << " --- wtf2: " << section.sheetRootNode()->to_string();
/*
if( contentNode->attribute("State") == section.sheetRootNode->attribute("State") )
{
//XQItem* newTreeentry = _itemFactory.makeTreeChildItem( contentNode, section.sheetRootNode );
makeTreeChildItem:
// den itemtype des neuen items rausfinden
QString typeKey = sheetEntry->attribute("ItemType");
XQItemType* itemType = findItemTypeTemplate(typeKey); // throws
//XQItemType* itemType = makeItemType(sheetEntry); // throws
if( contentNode->attribute( c_ContentType) == section.contentType() )
{
qDebug() << " --- wtf1: " << contentNode->to_string();
qDebug() << " --- wtf2: " << section.sectionRootNode()->to_string();
qDebug() << " --- wtf3: " << section.sheetRootNode()->to_string();
const QString* contentPtr = contentNode->attribute_ptr( "ProjectName" );
// __fixme! das ist mist!
XQItem* newItem = _itemFactory.makeItem(section.sheetRootNode()->child(0), contentPtr );
XQItem* newItem = new XQItem( itemType, contentPtr );
section.headerItem().appendRow( newItem );
_treeTable->expand( section.modelIndex() );
// ??
_treeTable->setCurrentIndex( section.modelIndex() );
newItem->setContentNode(contentNode);
emit itemCreated( newItem );
return newItem;
section.headerItem().appendRow( newTreeentry );
_treeTable->expand( section.modelIndex );
// ??
_treeTable->setCurrentIndex( section.modelIndex );
newTreeentry->setContentNode(contentNode);
emit xqItemCreated( newTreeentry );
return newTreeentry;
}
*/
}
throw XQException( "createTreeEntry: main model should not be empty!" );
throw XQException( "makeTreeItem: main model should not be empty!" );
}