QElectroTech
0.70
|
The ElementCollectionHandler class Provide several method to copy element or directory from a collection to another collection. More...
#include <elementcollectionhandler.h>
Public Member Functions | |||||||
ElementCollectionHandler () | |||||||
ElementCollectionHandler::ElementCollectionHandler. More... | |||||||
~ElementCollectionHandler () | |||||||
ElementsLocation | copy (ElementsLocation &source, ElementsLocation &destination) | ||||||
ElementCollectionHandler::copy Copy the content of collection represented by source to the collection represented by destination. Destination must be a directory, else the copy do nothing and return a null ElementLocation if destination have an item with the same name of source, a dialog ask to user what to do. More... | |||||||
as child of @parent. | |||||||
ElementCollectionHandler::createDir Create a directorie with name Parent must be a directory
| |||||||
ElementsLocation | createDir (ElementsLocation &parent, const QString &name, const NamesList &name_list) | ||||||
bool | importFromProject (QETProject *project, ElementsLocation &location) | ||||||
ElementCollectionHandler::importFromProject Import the element represented by to the embedded collection of at the same path. must represente an element owned by a project embedded collection. More... | |||||||
bool | setNames (ElementsLocation &location, const NamesList &name_list) | ||||||
ElementCollectionHandler::setNames Set the names stored in as the names of the item represented by location. More... | |||||||
Private Attributes | |
ECHStrategy * | m_strategy = nullptr |
The ElementCollectionHandler class Provide several method to copy element or directory from a collection to another collection.
Definition at line 87 of file elementcollectionhandler.h.
ElementCollectionHandler::ElementCollectionHandler | ( | ) |
ElementCollectionHandler::ElementCollectionHandler.
widget |
Definition at line 304 of file elementcollectionhandler.cpp.
ElementCollectionHandler::~ElementCollectionHandler | ( | ) |
Definition at line 306 of file elementcollectionhandler.cpp.
References m_strategy.
ElementsLocation ElementCollectionHandler::copy | ( | ElementsLocation & | source, |
ElementsLocation & | destination | ||
) |
ElementCollectionHandler::copy Copy the content of collection represented by source to the collection represented by destination. Destination must be a directory, else the copy do nothing and return a null ElementLocation if destination have an item with the same name of source, a dialog ask to user what to do.
source | |
destination |
Definition at line 320 of file elementcollectionhandler.cpp.
References ECHStrategy::copy(), ElementsLocation::exist(), ElementsLocation::isElement(), ElementsLocation::isFileSystem(), ElementsLocation::isProject(), and m_strategy.
Referenced by ElementsCollectionModel::dropMimeData().
ElementsLocation ElementCollectionHandler::createDir | ( | ElementsLocation & | parent, |
const QString & | name, | ||
const NamesList & | name_list | ||
) |
Definition at line 343 of file elementcollectionhandler.cpp.
References ElementsLocation::addToPath(), ElementsLocation::collectionPath(), XmlElementCollection::createDir(), ElementsLocation::exist(), ElementsLocation::fileSystemPath(), ElementsLocation::isDirectory(), ElementsLocation::isFileSystem(), ElementsLocation::isProject(), ElementsLocation::isWritable(), ElementsLocation::projectCollection(), NamesList::toXml(), and QET::writeXmlFile().
Referenced by ElementsCategoryEditor::acceptCreation().
bool ElementCollectionHandler::importFromProject | ( | QETProject * | project, |
ElementsLocation & | location | ||
) |
ElementCollectionHandler::importFromProject Import the element represented by to the embedded collection of at the same path. must represente an element owned by a project embedded collection.
project | : project where copy the element |
location | : location to copy |
Definition at line 403 of file elementcollectionhandler.cpp.
References ElementsLocation::addToPath(), ElementsLocation::collectionPath(), XmlElementCollection::copy(), QETProject::embeddedElementCollection(), ElementsLocation::exist(), ElementsLocation::fileName(), ElementsLocation::isElement(), ElementsLocation::isProject(), and ElementsLocation::parent().
Referenced by Diagram::fromXml().
bool ElementCollectionHandler::setNames | ( | ElementsLocation & | location, |
const NamesList & | name_list | ||
) |
ElementCollectionHandler::setNames Set the names stored in as the names of the item represented by location.
location | : location to change the names |
name_list | : NamesList to use |
Definition at line 445 of file elementcollectionhandler.cpp.
References ElementsLocation::exist(), ElementsLocation::fileSystemPath(), ElementsLocation::isDirectory(), ElementsLocation::isElement(), ElementsLocation::isFileSystem(), ElementsLocation::isProject(), ElementsLocation::isWritable(), NamesList::toXml(), QET::writeXmlFile(), and ElementsLocation::xml().
Referenced by ElementsCategoryEditor::acceptUpdate().
|
private |
Definition at line 99 of file elementcollectionhandler.h.
Referenced by copy(), and ~ElementCollectionHandler().