59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
/***************************************************************************
|
|
|
|
source::worx xtree
|
|
Copyright © 2024-2025 c.holzheuer
|
|
christoph.holzheuer@gmail.com
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
#include <xqdocumentstore.h>
|
|
#include <xqitem.h>
|
|
#include <QFile>
|
|
|
|
|
|
|
|
|
|
|
|
XQDocument::XQDocument(const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQModel* aModelView )
|
|
: fileName{ aFileName }, friendlyName{ aFriendlyName }, treeItem{ aTreeItem }, modelView{ aModelView }
|
|
{
|
|
|
|
}
|
|
|
|
XQDocument::~XQDocument()
|
|
{
|
|
//delete _documentRoot;
|
|
}
|
|
|
|
|
|
///
|
|
/// ---
|
|
///
|
|
|
|
|
|
XQDocumentStore::~XQDocumentStore()
|
|
{
|
|
//for (auto entry : *this)
|
|
// delete entry;
|
|
//for( int i=0; i<size();++i)
|
|
// delete at(i);
|
|
}
|
|
|
|
|
|
|
|
void XQDocumentStore::addDocument( const QString& aFileName, const QString& aFriendlyName, XQItem* aTreeItem, XQModel* aModelView )
|
|
{
|
|
//qDebug() << " --- addDoc: " << aDocumentRoot->friendly_name() << " : " << aDocumentRoot->attribute(c_ProjectID);
|
|
XQDocument newDocument( aFileName, aFriendlyName, aTreeItem,aModelView );
|
|
addAtKey( aFileName, newDocument );
|
|
// attention: this assumes the presence of the 'ProjectID' value
|
|
addAlias( aFileName, aTreeItem->attribute(c_ProjectID) );
|
|
}
|
|
|