-- semi-fy

This commit is contained in:
2025-09-06 22:13:46 +02:00
parent 0fe15d6043
commit 1531ec14f1
4 changed files with 15 additions and 4 deletions

View File

@@ -345,7 +345,8 @@ void XQViewModel::cmdCut( const XQCommand& command )
const XQNodeBackup& entry = *it;
XQItem& firstItem = xqFirstItem( (*it).itemPos );
qDebug() << " --- Cut: " << firstItem.text() << " " << firstItem.row() << " id#" << entry.contentNode->_id;
//qDebug() << " --- Cut: " << firstItem.text() << " " << firstItem.row() << " id#" << entry.contentNode->_id;
qDebug() << " ---- command CUT: itemPos: " << entry.itemPos << " nodePos: "<< entry.nodePos << " is " << entry.contentNode->friendly_name();
entry.contentNode->unlink_self();
removeRow(entry.itemPos );
@@ -357,10 +358,14 @@ void XQViewModel::cmdCut( const XQCommand& command )
void XQViewModel::cmdCutUndo( const XQCommand& command )
{
// die anfangsposition
int itmPos = command.first().itemPos;
// die 'zuständige' section rausfinden
const XQModelSection& section = _sections.sectionByRow( itmPos );
qDebug() << " --- HEADSHOT: " << itmPos << "->" << section.contentType();
// über alle einträge ...
for (auto& entry : command )
{
@@ -368,11 +373,13 @@ void XQViewModel::cmdCutUndo( const XQCommand& command )
// __fix! should not be _contentRoot!
savedNode->add_me_at( entry.nodePos, _contentRoot );
XQItemList list = _itemFactory.makeRow( section.sheetRootNode(), savedNode );
insertRow( entry.itemPos, list );
XQItem& firstItem = *((XQItem*)list[0]);
qDebug() << " ---- command cut UNDO2: itemPos: " << entry.itemPos << " nodePos: "<< entry.nodePos << " is " << entry.contentNode->friendly_name();
qDebug() << " --- Cut Undo: " << firstItem.text() << " " << firstItem.row() << " id#" << entry.contentNode->_id << " count: " << entry.contentNode.use_count();
insertRow( entry.itemPos, list );
}
}