fixed delete undo.
This commit is contained in:
		| @@ -36,9 +36,8 @@ XQChildModel::XQChildModel( QObject *parent ) | ||||
| void XQChildModel::addModelData( const XQNodePtr& contentRoot ) | ||||
| { | ||||
|  | ||||
|   // __fix: set object name ?? | ||||
|  | ||||
|   qDebug() << " --- create Model Data: " << contentRoot->to_string(); | ||||
|   setObjectName( contentRoot->to_string() ); | ||||
|   //qDebug() << " --- create Model Data: " << contentRoot->to_string(); | ||||
|  | ||||
|   // Die Datenbasis als shared_ptr sichern | ||||
|   _contentRoot = contentRoot; | ||||
|   | ||||
| @@ -52,8 +52,6 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode ) | ||||
|   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") ); | ||||
| @@ -65,31 +63,12 @@ XQItem* XQMainModel::addProjectItem( XQNodePtr contentNode ) | ||||
|     expandNewItem(section.headerItem().index() ); | ||||
|     return newItem; | ||||
|   } | ||||
|  | ||||
|   /* | ||||
|   for(const auto& section : _sections ) | ||||
|   { | ||||
|     if( contentNode->attribute(c_ContentType) == section.contentType() ) | ||||
|     { | ||||
|       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; | ||||
|     } | ||||
|   } | ||||
|   */ | ||||
|  | ||||
|   throw XQException( "addProjectItem: main model should not be empty!" ); | ||||
| } | ||||
|  | ||||
|  | ||||
| //! erzeugt einen einzelen baum-eintrag mit hilfe der section und den projekt-daten | ||||
|  | ||||
| void XQMainModel::addSectionItem( const XQModelSection& section, XQItem* projectItem ) | ||||
| { | ||||
|   XQNodePtr sheetNode = projectItem->sheetNode()->find_child_by_tag_name("CurrentSection"); | ||||
|   | ||||
| @@ -110,7 +110,7 @@ void XQMainWindow::initMainWindow() | ||||
|     _mainTreeView->setCurrentIndex( item.index() ); | ||||
|     // ... we set the current view to this node | ||||
|     if( _documentStore.contains( pID ) ) | ||||
|       _tabWidget->setCurrentWidget( _documentStore[pID].modelView->treeTable() ); | ||||
|       _tabWidget->setCurrentWidget( _documentStore[pID].viewModel->treeTable() ); | ||||
|   } ); | ||||
|   */ | ||||
|  | ||||
| @@ -257,19 +257,7 @@ void XQMainWindow::onAbout() | ||||
|  | ||||
| void XQMainWindow::onTreeViewItemClicked( const XQItem& item ) | ||||
| { | ||||
|   /* | ||||
|   _mainTreeView->selectionModel()->select(item.index(), QItemSelectionModel::Select); | ||||
|  | ||||
|   if( XQNodePtr contentNode = item.contentNode() ) | ||||
|   { | ||||
|     QString key = contentNode->attribute(c_ProjectID); | ||||
|     bool isThere = _documentStore.contains(key); | ||||
|     if( isThere) | ||||
|       _tabWidget->setCurrentWidget( _documentStore[key].viewModel->treeTable() ); | ||||
|   } | ||||
|   */ | ||||
|  | ||||
|   qDebug() << " --- Tree item CLICK:"  << item.text() << " : " << item.itemType().text(); | ||||
|   //qDebug() << " --- Tree item CLICK:"  << item.text() << " : " << item.itemType().text(); | ||||
|   if( item.itemType().text() == "TreeChildType" ) | ||||
|   { | ||||
|     setChildTabByName( item.text() ); | ||||
| @@ -278,7 +266,7 @@ void XQMainWindow::onTreeViewItemClicked( const XQItem& item ) | ||||
|  | ||||
| void XQMainWindow::onTreeViewItemChanged(const XQItem& item ) | ||||
| { | ||||
|   qDebug() << " --- TREE VIEW itemChanged:" << item.text() << " : " << item.parent()->text(); | ||||
|   //qDebug() << " --- TREE VIEW itemChanged:" << item.text() << " : " << item.parent()->text(); | ||||
|   // hier müssen wir erst das projekt aktivieren | ||||
|   XQItem* xqItem = static_cast<XQItem*>(item.parent()); | ||||
|   onTreeViewItemClicked( *xqItem ); | ||||
| @@ -307,7 +295,7 @@ void XQMainWindow::onChildViewTabClicked( int idx ) | ||||
| } | ||||
|  | ||||
|  | ||||
| //! firz | ||||
| //! SLOT, der aufgerufen wird, sobald eine section erzeugt worden ist. | ||||
|  | ||||
| void XQMainWindow::onSectionCreated( const XQModelSection& section ) | ||||
| { | ||||
| @@ -318,16 +306,22 @@ void XQMainWindow::onSectionCreated( const XQModelSection& section ) | ||||
|   } | ||||
| } | ||||
|  | ||||
|  | ||||
| //! SLOT, der aufgerufen wird, wenn eine section getoggelt wurde. | ||||
|  | ||||
| void XQMainWindow::onSectionToggled( const XQModelSection& section ) | ||||
| { | ||||
|   qDebug() << " --- XXX section toggled: " << section.contentType() << ":" << section.sheetRootNode()->to_string(); | ||||
| } | ||||
|  | ||||
|  | ||||
| //! firz | ||||
|  | ||||
| void XQMainWindow::setChildTabByName( const QString& key ) | ||||
| { | ||||
|   for( int i=0; i<_documentStore.size(); ++i ) | ||||
|   { | ||||
|     if( key ==  _documentStore[i].friendlyName) | ||||
|     if( key == _documentStore[i].friendlyName) | ||||
|     { | ||||
|       _tabWidget->setCurrentIndex(i); | ||||
|       return; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user