Fix some doxygen issues (~100)

This commit is contained in:
Simon De Backer
2020-08-18 20:07:55 +02:00
parent b5f212418c
commit 790cdc5229
22 changed files with 205 additions and 154 deletions

View File

@@ -334,7 +334,7 @@ ElementsLocation ElementCollectionHandler::copy(ElementsLocation &source, Elemen
/**
@brief ElementCollectionHandler::createDir
Create a directorie with name @name as child of @parent.
Create a directorie with name as child of parent.
Parent must be a directory
@param parent : parent of the dir to create
@param name : name of directorie to create
@@ -395,8 +395,9 @@ ElementsLocation ElementCollectionHandler::createDir(ElementsLocation &parent, c
/**
@brief ElementCollectionHandler::importFromProject
Import the element represented by @location to the embedded collection of @project at the same path.
@location must represente an element owned by a project embedded collection
Import the element represented by location to the embedded collection
of project at the same path.
location must represente an element owned by a project embedded collection
@param project : project where copy the element
@param location : location to copy
@return true if import with success
@@ -438,7 +439,8 @@ bool ElementCollectionHandler::importFromProject(QETProject *project, ElementsLo
/**
@brief ElementCollectionHandler::setNames
Set the names stored in @name_list as the names of the item represented by location
Set the names stored in name_list as the names
of the item represented by location
@param location : location to change the names
@param name_list : NamesList to use
@return return true if success

View File

@@ -39,11 +39,15 @@ void ElementCollectionItem::clearData()
/**
@brief ElementCollectionItem::lastItemForPath
Return the last existing item in this ElementCollectionItem hierarchy according to the given path.
Next_item is the first non existing item in this hierarchy according to the given path.
@param path : The path to find last item. The path must be in form : path/otherPath/.../.../myElement.elmt.
Return the last existing item in this ElementCollectionItem hierarchy
according to the given path.
Next_item is the first non existing item in this hierarchy according
to the given path.
@param path : The path to find last item.
The path must be in form : path/otherPath/.../.../myElement.elmt.
@param no_found_path : The first item that not exist in this hierarchy
@return : The last item that exist in this hierarchy, or nullptr can't find (an error was occurred, or path already exist)
@return : The last item that exist in this hierarchy,
or nullptr can't find (an error was occurred, or path already exist)
*/
ElementCollectionItem *ElementCollectionItem::lastItemForPath(const QString &path, QString &no_found_path)
{
@@ -68,7 +72,7 @@ ElementCollectionItem *ElementCollectionItem::lastItemForPath(const QString &pat
/**
@brief ElementCollectionItem::childWithCollectionName
Return the child with the collection name @name, else return nullptr
Return the child with the collection name name, else return nullptr
@param name
@return
*/
@@ -101,10 +105,10 @@ QList<QStandardItem *> ElementCollectionItem::directChilds() const
/**
@brief ElementCollectionItem::rowForInsertItem
Return the row for insert a new child item to this item with name @collection_name.
If row can't be found (collection_name is null, or already exist) return -1;
@param collection_name
Return the row for insert a new child item to this item with name.
@param name
@return
If row can't be found (name is null, or already exist) return -1;
*/
int ElementCollectionItem::rowForInsertItem(const QString &name)
{
@@ -112,7 +116,7 @@ int ElementCollectionItem::rowForInsertItem(const QString &name)
return -1;
QList <ElementCollectionItem *> child;
//The item to insert is an element we search from element child
//The item to insert is an element we search from element child
if (name.endsWith(".elmt"))
{
child = elementsDirectChild();
@@ -120,7 +124,7 @@ int ElementCollectionItem::rowForInsertItem(const QString &name)
if (child.isEmpty())
return rowCount();
}
//The item is a directory, we search from directory child
//The item is a directory, we search from directory child
else
{
child = directoriesDirectChild();

View File

@@ -500,7 +500,7 @@ QList <ElementCollectionItem *> ElementsCollectionModel::items() const
/**
@brief ElementsCollectionModel::projectItems
@param project
@return return all items for project @project. the list can be empty
@return return all items for project. the list can be empty
*/
QList<ElementCollectionItem *> ElementsCollectionModel::projectItems(QETProject *project) const
{
@@ -531,7 +531,7 @@ void ElementsCollectionModel::hideElement()
/**
@brief ElementsCollectionModel::indexFromLocation
Return the index who represent @location.
Return the index who represent location.
Index can be non valid
@param location
@return

View File

@@ -46,21 +46,22 @@ ElementsCollectionWidget::ElementsCollectionWidget(QWidget *parent):
QWidget(parent),
m_model(nullptr)
{
//The connection in the method ElementsCollectionWidget::reload return a warning message at compilation :
//**********
//QObject::connect: Cannot queue arguments of type 'QVector<int>'
//(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
//**********
//Register meta type has recommended by the message.
//The connection in the method ElementsCollectionWidget::reload
//return a warning message at compilation :
//**********
//QObject::connect: Cannot queue arguments of type 'QVector<int>'
//(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
//**********
//Register meta type has recommended by the message.
qRegisterMetaType<QVector<int>>();
setUpWidget();
setUpAction();
setUpConnection();
//Timer is used to avoid launching a new search for each letter typed by user
//Timer is started or restarted at every time user type a new letter.
//When the timer emit timeout, we start the search.
//Timer is used to avoid launching a new search for each letter typed by user
//Timer is started or restarted at every time user type a new letter.
//When the timer emit timeout, we start the search.
m_search_timer.setInterval(500);
m_search_timer.setSingleShot(true);
}
@@ -80,7 +81,7 @@ void ElementsCollectionWidget::expandFirstItems()
/**
@brief ElementsCollectionWidget::addProject
Add @project to be displayed
Add project to be displayed
@param project
*/
void ElementsCollectionWidget::addProject(QETProject *project)
@@ -105,7 +106,7 @@ void ElementsCollectionWidget::removeProject(QETProject *project) {
/**
@brief ElementsCollectionWidget::highlightUnusedElement
highlight the unused element
@See ElementsCollectionModel::highlightUnusedElement()
@see ElementsCollectionModel::highlightUnusedElement()
*/
void ElementsCollectionWidget::highlightUnusedElement()
{
@@ -115,7 +116,7 @@ void ElementsCollectionWidget::highlightUnusedElement()
/**
@brief ElementsCollectionWidget::setCurrentLocation
Set the current item to be the item for @location
Set the current item to be the item for location
@param location
*/
void ElementsCollectionWidget::setCurrentLocation(
@@ -771,11 +772,11 @@ void ElementsCollectionWidget::hideCollection(bool hide)
/**
@brief ElementsCollectionWidget::hideItem
Hide the item index. If @recursive is true,
Hide the item index. If recursive is true,
hide all subchilds of index
@param hide- true = hide , false = visible
@param index- index to hide
@param recursive- true = apply to child , false = only for index
@param hide : - true = hide , false = visible
@param index : - index to hide
@param recursive : - true = apply to child , false = only for index
*/
void ElementsCollectionWidget::hideItem(bool hide,
const QModelIndex &index,

View File

@@ -64,7 +64,7 @@ void ElementsTreeView::startDrag(Qt::DropActions supportedActions)
/**
@brief ElementsTreeView::startElementDrag
Build a QDrag according to the content of @location
Build a QDrag according to the content of location
@param location : location to use for create the content of the QDrag
*/
void ElementsTreeView::startElementDrag(const ElementsLocation &location)

View File

@@ -241,7 +241,7 @@ bool FileElementCollectionItem::isCustomCollection() const
/**
@brief FileElementCollectionItem::addChildAtPath
Ask to this item item to add a child
with collection name @collection_name
with collection name collection_name
@param collection_name
*/
void FileElementCollectionItem::addChildAtPath(const QString &collection_name)

View File

@@ -25,10 +25,12 @@
@brief XmlElementCollection::XmlElementCollection
Build an empty collection.
The collection start by :
* <collection>
* <category name="import>
* </category>
* </collection>
@code{xml}
<collection>
<category name="import>
</category>
</collection>
@endcode
All elements and category are stored as child of <category name="import>
@param project : the project of this collection
*/
@@ -72,8 +74,10 @@ XmlElementCollection::XmlElementCollection(QETProject *project) :
/**
@brief XmlElementCollection::XmlElementCollection
Constructor with an collection. The tagName of @dom_element must be "collection"
@param dom_element -the collection in a dom_element (the dom element in cloned)
Constructor with an collection.
The tagName of dom_element must be "collection"
@param dom_element :
-the collection in a dom_element (the dom element in cloned)
@param project : the project of this collection
*/
XmlElementCollection::XmlElementCollection(const QDomElement &dom_element, QETProject *project) :
@@ -108,7 +112,7 @@ QDomElement XmlElementCollection::importCategory() const {
/**
@brief XmlElementCollection::childs
@param parent_element
@return All childs element in the @parent_element tree
@return All childs element in the parent_element tree
*/
QDomNodeList XmlElementCollection::childs(const QDomElement &parent_element) const
{
@@ -118,10 +122,13 @@ QDomNodeList XmlElementCollection::childs(const QDomElement &parent_element) con
/**
@brief XmlElementCollection::child
If parent_element have child element with an attribute name = @child_name, return it, else return a null QDomElement.
Only search for element with tag-name "category" and "element" (if child_name end with ".elmt")
If parent_element have child element
with an attribute name = child_name, return it,
else return a null QDomElement.
Only search for element with tag-name "category" and "element"
(if child_name end with ".elmt")
@param parent_element : the parent DomElement where we search for child.
@parent_element must be a child node of this XmlElementCollection.
parent_element must be a child node of this XmlElementCollection.
@param child_name : name of child to search.
@return The child QDomElement or a null QDomElement if not found
*/
@@ -175,7 +182,7 @@ QDomElement XmlElementCollection::child(const QString &path) const
/**
@brief XmlElementCollection::directories
@param parent_element
@return A list of directory stored in @parent_element
@return A list of directory stored in parent_element
*/
QList<QDomElement> XmlElementCollection::directories(const QDomElement &parent_element) const
{
@@ -196,7 +203,7 @@ QList<QDomElement> XmlElementCollection::directories(const QDomElement &parent_e
/**
@brief XmlElementCollection::directoriesNames
@param parent_element
@return a list of names for every child directories of @parent_element
@return a list of names for every child directories of parent_element
*/
QStringList XmlElementCollection::directoriesNames(const QDomElement &parent_element) const
{
@@ -216,7 +223,7 @@ QStringList XmlElementCollection::directoriesNames(const QDomElement &parent_ele
/**
@brief XmlElementCollection::elements
@param parent_element
@return A list of element stored in @parent_element
@return A list of element stored in parent_element
*/
QList<QDomElement> XmlElementCollection::elements(const QDomElement &parent_element) const
{
@@ -237,7 +244,7 @@ QList<QDomElement> XmlElementCollection::elements(const QDomElement &parent_elem
/**
@brief XmlElementCollection::elementsNames
@param parent_element
@return A list of names fr every childs element of @parent_element
@return A list of names fr every childs element of parent_element
*/
QStringList XmlElementCollection::elementsNames(const QDomElement &parent_element) const
{
@@ -257,7 +264,7 @@ QStringList XmlElementCollection::elementsNames(const QDomElement &parent_elemen
/**
@brief XmlElementCollection::element
@param path : path of the element in this collection
@return the QDomElement that represent the element at path @path
@return the QDomElement that represent the element at path path
or a null QDomElement if not found or doesn't represent an element
*/
QDomElement XmlElementCollection::element(const QString &path) const
@@ -275,7 +282,7 @@ QDomElement XmlElementCollection::element(const QString &path) const
/**
@brief XmlElementCollection::directory
@param path : path of the directory in this collection
@return the QDomElement that represent the directory at path @path
@return the QDomElement that represent the directory at path path
or a null QDomElement if not found.
*/
QDomElement XmlElementCollection::directory(const QString &path) const
@@ -291,35 +298,39 @@ QDomElement XmlElementCollection::directory(const QString &path) const
/**
@brief XmlElementCollection::addElement
Add the element at location to this collection.
The element is copied in this collection in "import" dir with the same path, in other word
if the path is dir1/dir2/dir3/myElement.elmt, myElement is copied to this collection at the path : import/dir1/dir2/dir3/myElement.elmt
The element is copied in this collection
in "import" dir with the same path, in other word
if the path is dir1/dir2/dir3/myElement.elmt,
myElement is copied to this collection at the
path : import/dir1/dir2/dir3/myElement.elmt
If the path doesn't exist, he was created.
If the element already exist, do nothing.
@param location, location of the element
@return the collection path of the added item or a null QString if element can't be added.
@return the collection path of the added item
or a null QString if element can't be added.
*/
QString XmlElementCollection::addElement(ElementsLocation &location)
{
//location must be an element and exist
//location must be an element and exist
if (!(location.exist() && location.isElement()))
return QString();
//Add an element from this collection to this collection have no sense
//Add an element from this collection to this collection have no sense
if (location.isProject() && location.projectCollection() == this)
return QString();
//First we check if this location exist in this collection if so, we do nothing
//First we check if this location exist in this collection if so, we do nothing
if ( exist("import/" + location.collectionPath(false)) )
return QString();
//Get the import dir of this collection
//Get the import dir of this collection
QDomElement parent_element = importCategory();
if (parent_element.isNull())
return QString();
QString integrated_path = parent_element.attribute("name");
//Split the path
//Split the path
QStringList splitted_path = location.collectionPath(false).split("/");
if (splitted_path.isEmpty())
return QString();
@@ -333,11 +344,11 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
foreach(QString str, splitted_path) {
QDomElement child_element = child(parent_element, str);
//Child doesn't exist, we create it
//Child doesn't exist, we create it
if (child_element.isNull()) {
QDomElement created_child;
//str is the path of an element, we integrate an element
//str is the path of an element, we integrate an element
if (str.endsWith(".elmt")) {
QFile element_file(dir.filePath(str));
if (!element_file.exists())
@@ -346,9 +357,9 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
created_child = QETXML::fileSystemElementToXmlCollectionElement(m_dom_document, element_file);
}
//str is the path of a directory, we integrate a directory.
//str is the path of a directory, we integrate a directory.
else {
//Dir doesn't exist.
//Dir doesn't exist.
if (!dir.cd(str))
return QString();
@@ -361,7 +372,7 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
parent_element.appendChild(created_child);
parent_element = created_child;
}
//Child exist
//Child exist
else {
if (!dir.cd(str))
return QString();
@@ -382,11 +393,11 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
QDomElement child_element = child(parent_element, str);
//Child doesn't exist, we create it
//Child doesn't exist, we create it
if (child_element.isNull()) {
QDomElement created_child;
//str is the path of an element, we integrate an element
//str is the path of an element, we integrate an element
if (str.endsWith(".elmt")) {
created_child = m_dom_document.createElement("element");
created_child.setAttribute("name", str);
@@ -394,7 +405,7 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
created_child.appendChild(location.xml().cloneNode(true));
}
//str is the path of a directory, we integrate a directory.
//str is the path of a directory, we integrate a directory.
else {
created_child = m_dom_document.createElement("category");
created_child.setAttribute("name", str);
@@ -410,7 +421,7 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
parent_element.appendChild(created_child);
parent_element = created_child;
}
//Child exist
//Child exist
else
parent_element = child_element;
@@ -424,12 +435,15 @@ QString XmlElementCollection::addElement(ElementsLocation &location)
/**
@brief XmlElementCollection::addElementDefinition
Add the élément defintion @xml_definition in the directory at path @dir_path with the name @elmt_name.
@param dir_path : the path of the directory where we must add the element.
Add the élément defintion xml_definition
in the directory at path dir_path with the name elmt_name.
@param dir_path :
the path of the directory where we must add the element.
The path must be an existing directory of this collection.
@param elmt_name : The name used to store the element (the name must end with .elmt, if not, .elmt will be append to @elmt_name)
@param elmt_name : The name used to store the element
(the name must end with .elmt, if not, .elmt will be append to elmt_name)
@param xml_definition : The xml definition of the element.
The tag name of @xml_definition must be "definition".
The tag name of xml_definition must be "definition".
@return True if the element is added with success.
*/
bool XmlElementCollection::addElementDefinition(const QString &dir_path, const QString &elmt_name, const QDomElement &xml_definition)
@@ -462,7 +476,7 @@ bool XmlElementCollection::addElementDefinition(const QString &dir_path, const Q
/**
@brief XmlElementCollection::removeElement
Remove the element at path @path.
Remove the element at path path.
@param path
@return True if element is removed and emit the signal elementRemoved.
else false.
@@ -482,14 +496,19 @@ bool XmlElementCollection::removeElement(const QString& path)
/**
@brief XmlElementCollection::copy
Copy the content represented by source (an element or a directory) to destination.
Copy the content represented by source (an element or a directory)
to destination.
Destination must be a directory of this collection.
If the destination already have an item at the same path of source, he will be replaced by source.
If the destination already have an item at the same path of source,
he will be replaced by source.
@param source : content to copy
@param destination : destination of the copy, must be a directory of this collection
@param rename : rename the copy with @rename else use the name of source
@param deep_copy : if true copy all childs of source (only if source is directory)
@return the ElementLocation that represent the copy, if copy failed return a null ElementLocation
@param destination : destination of the copy, must be a directory
of this collection
@param rename : rename the copy with rename else use the name of source
@param deep_copy : if true copy all childs of source
(only if source is directory)
@return the ElementLocation that represent the copy,
if copy failed return a null ElementLocation
*/
ElementsLocation XmlElementCollection::copy(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy)
{
@@ -504,7 +523,7 @@ ElementsLocation XmlElementCollection::copy(ElementsLocation &source, ElementsLo
/**
@brief XmlElementCollection::exist
Return true if the path @path exist in this collection
Return true if the path path exist in this collection
@param path
@return
*/
@@ -552,7 +571,7 @@ bool XmlElementCollection::createDir(const QString& path, const QString& name, c
/**
@brief XmlElementCollection::removeDir
Remove the directory at path @path.
Remove the directory at path path.
@param path
@return true if successfuly removed and emit directoryRemoved(QString),
else false.
@@ -574,7 +593,8 @@ bool XmlElementCollection::removeDir(const QString& path)
If dom_element is null, return all location owned by this collection
dom_element must be a child of this collection.
@param dom_element : dom_element where we must to search location.
@param childs = if true return all childs location of dom_element, if false, only return the direct childs location of dom_element.
@param childs = if true return all childs location of dom_element,
if false, only return the direct childs location of dom_element.
@return
*/
QList<ElementsLocation> XmlElementCollection::elementsLocation(QDomElement dom_element, bool childs) const
@@ -615,7 +635,8 @@ QList<ElementsLocation> XmlElementCollection::elementsLocation(QDomElement dom_e
@brief XmlElementCollection::domToLocation
Return the element location who represent the xml element : dom_element
dom_element must be owned by this collection
@param dom_element : the dom_element of this collection that represent an element.
@param dom_element :
the dom_element of this collection that represent an element.
The tag name of dom_element must be "element"
@return the element location, location can be null if fail.
*/
@@ -668,18 +689,20 @@ void XmlElementCollection::cleanUnusedDirectory()
/**
@brief XmlElementCollection::copyDirectory
Copy the directory represented by source to destination.
if destination have a directory with the same name as source, then this directory is removed
if destination have a directory with the same name as source,
then this directory is removed
@param source : directory to copy
@param destination : destination of the copy
@param rename : rename the copy with @rename else use the name of source
@param rename : rename the copy with rename else use the name of source
@param deep_copy :if true copy all childs of source
@return the ElementLocation that represent the copy, if copy failed return a null ElementLocation
@return the ElementLocation that represent the copy,
if copy failed return a null ElementLocation
*/
ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy)
{
QString new_dir_name = rename.isEmpty() ? source.fileName() : rename;
//Get the xml directory where the new directory must be added
//Get the xml directory where the new directory must be added
QDomElement parent_dir_dom = directory(destination.collectionPath(false));
if (parent_dir_dom.isNull()) return ElementsLocation();
@@ -692,7 +715,7 @@ ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, E
ElementsLocation created_location;
//Copy with a file system collection source
//Copy with a file system collection source
if (source.isFileSystem())
{
QDir source_dir(source.fileSystemPath());
@@ -716,7 +739,7 @@ ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, E
copyDirectory(sub_source, created_location);
}
//Append all elements of source to the new created directory
//Append all elements of source to the new created directory
source_dir.setNameFilters(QStringList() << "*.elmt");
foreach(QString str, source_dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name))
{
@@ -726,14 +749,15 @@ ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, E
}
}
//Copy with a xml collection source
//Copy with a xml collection source
else
{
if (!source.projectCollection()) return ElementsLocation();
QDomNode other_collection_node = source.projectCollection()->child(source.collectionPath(false)).cloneNode(deep_copy);
//We don't make a deep copy, but we must to get the local names of the copied directory
//We don't make a deep copy,
// but we must to get the local names of the copied directory
if (!deep_copy) {
QDomNode names = source.projectCollection()->child(source.collectionPath(false)).namedItem("names");
if (!names.isNull() && names.isElement())
@@ -759,7 +783,7 @@ ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, E
If element already exist in destination he will be replaced by the new.
@param source : element to copy
@param destination : destination of the copy
@param rename : rename the copy with @rename else use the name of source
@param rename : rename the copy with rename else use the name of source
@return The ElementsLocation of the copy
*/
ElementsLocation XmlElementCollection::copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
@@ -768,14 +792,14 @@ ElementsLocation XmlElementCollection::copyElement(ElementsLocation &source, Ele
QDomElement elmt_dom;
//Copy with a file system collection source
//Copy with a file system collection source
if (source.isFileSystem())
{
QFile file(source.fileSystemPath());
elmt_dom = QETXML::fileSystemElementToXmlCollectionElement(m_dom_document, file, new_elmt_name);
if (elmt_dom.isNull()) return ElementsLocation();
}
//Copy with a xml collection source
//Copy with a xml collection source
else
{
QDomElement other_collection = source.xml();

View File

@@ -129,7 +129,7 @@ bool XmlProjectElementCollectionItem::isCollectionRoot() const
/**
@brief XmlProjectElementCollectionItem::addChildAtPath
Ask to this item item to add a new child with collection name @collection_name
Ask to this item item to add a new child with collection name collection_name
(the child must exist in the xml element collection)
@param collection_name : name of the child item to add.
*/