Project embedded collection, Clean unused elements and empty directory work again

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4568 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-07-09 18:24:40 +00:00
parent b6816c9e49
commit 518f0efd46
5 changed files with 123 additions and 4 deletions

View File

@@ -50,13 +50,18 @@ class XmlElementCollection : public QObject
QDomElement directory(const QString &path) const;
QString addElement (ElementsLocation &location);
bool addElementDefinition (const QString &dir_path, const QString &elmt_name, const QDomElement &xml_definition);
bool removeElement(QString path);
ElementsLocation copy (ElementsLocation &source, ElementsLocation &destination, QString rename = QString(), bool deep_copy = true);
bool exist (const QString &path) const;
bool createDir (QString path, QString name, const NamesList &name_list);
bool removeDir (QString path);
QList <ElementsLocation> elementsLocation (QDomElement dom_element = QDomElement(), bool childs = true) const;
ElementsLocation domToLocation(QDomElement dom_element) const;
void cleanUnusedElement();
void cleanUnusedDirectory();
private:
ElementsLocation copyDirectory(ElementsLocation &source, ElementsLocation &destination, QString rename = QString(), bool deep_copy = true);
ElementsLocation copyElement(ElementsLocation &source, ElementsLocation &destination, QString rename = QString());
@@ -74,12 +79,24 @@ class XmlElementCollection : public QObject
* @param collection_path, the path of this element in this collection
*/
void elementChanged (QString collection_path);
/**
* @brief elementRemoved
* This signal is emited when an element is removed to this collection
* @param collection_path, the path of the removed element in this collection
*/
void elementRemoved(QString collection_path);
/**
* @brief directorieAdded
* This signal is emited when a directorie is added to this collection
* @param collection_path, the path of the new directorie
*/
void directorieAdded(QString collection_path);
/**
* @brief directoryRemoved
* This signal is emited when a directory is removed to this collection
* @param collection_path, the path of the removed directory
*/
void directoryRemoved(QString collection_path);
private:
QDomDocument m_dom_document;