QElectroTech  0.8-dev
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
FileElementCollectionItem Class Reference

The FileElementCollectionItem class This class specialise ElementCollectionItem for manage a collection in a file system. They represente a directory or an element. More...

#include <fileelementcollectionitem.h>

Inheritance diagram for FileElementCollectionItem:
Inheritance graph
Collaboration diagram for FileElementCollectionItem:
Collaboration graph

Public Types

enum  { Type = UserType+2 }
 
- Public Types inherited from ElementCollectionItem
enum  { Type = UserType+1 }
 

Public Member Functions

 FileElementCollectionItem ()
 FileElementCollectionItem::FileElementCollectionItem Constructor. More...
 
int type () const override
 
bool setRootPath (const QString &path, bool set_data=true, bool hide_element=false)
 FileElementCollectionItem::setRootPath Set path has root path for this file item. Use this function only to set the beginning of a file collection. More...
 
QString fileSystemPath () const
 FileElementCollectionItem::fileSystemPath. More...
 
QString dirPath () const
 FileElementCollectionItem::dirPath. More...
 
bool isDir () const override
 FileElementCollectionItem::isDir. More...
 
bool isElement () const override
 FileElementCollectionItem::isElement. More...
 
QString localName () override
 FileElementCollectionItem::localName. More...
 
QString localName (const ElementsLocation &location)
 FileElementCollectionItem::localName Surcharged method, unlike the default method, avoid to create an elementLocation and so, gain time. More...
 
QString name () const override
 FileElementCollectionItem::name. More...
 
QString collectionPath () const override
 FileElementCollectionItem::collectionPath. More...
 
bool isCollectionRoot () const override
 FileElementCollectionItem::isCollectionRoot. More...
 
bool isCommonCollection () const
 FileElementCollectionItem::isCommonCollection. More...
 
bool isCustomCollection () const
 FileElementCollectionItem::isCustomCollection. More...
 
void addChildAtPath (const QString &collection_name) override
 FileElementCollectionItem::addChildAtPath Ask to this item item to add a child with collection name collection_name. More...
 
void setUpData () override
 FileElementCollectionItem::setUpData SetUp the data of this item. More...
 
void setUpIcon () override
 FileElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memory, we use this method for setup icon instead setUpData. More...
 
- Public Member Functions inherited from ElementCollectionItem
 ElementCollectionItem ()
 ElementCollectionItem::ElementCollectionItem Constructor. More...
 
int type () const override
 
virtual void clearData ()
 ElementCollectionItem::clearData Reset the data. More...
 
ElementCollectionItemlastItemForPath (const QString &path, QString &no_found_path)
 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. More...
 
ElementCollectionItemchildWithCollectionName (const QString &name) const
 ElementCollectionItem::childWithCollectionName Return the child with the collection name name, else return nullptr. More...
 
QList< QStandardItem * > directChilds () const
 ElementCollectionItem::directChilds Return the direct child of this item. More...
 
int rowForInsertItem (const QString &name)
 ElementCollectionItem::rowForInsertItem Return the row for insert a new child item to this item with name. More...
 
ElementCollectionItemitemAtPath (const QString &path)
 ElementCollectionItem::itemAtPath. More...
 
QList< ElementCollectionItem * > elementsDirectChild () const
 ElementCollectionItem::elementsDirectChild. More...
 
QList< ElementCollectionItem * > directoriesDirectChild () const
 ElementCollectionItem::directoriesDirectChild. More...
 
QList< ElementCollectionItem * > elementsChild () const
 ElementCollectionItem::elementsChild. More...
 
QList< ElementCollectionItem * > directoriesChild () const
 ElementCollectionItem::directoriesChild. More...
 
QList< ElementCollectionItem * > items () const
 ElementCollectionItem::items. More...
 

Private Member Functions

void setPathName (const QString &path_name, bool set_data=true, bool hide_element=false)
 FileElementCollectionItem::setPathName Set the name of this item in the file system path. This item must have a parent, because they should be a child item of another. For create a new file collection see setRootPath. More...
 
void populate (bool set_data=true, bool hide_element=false)
 FileElementCollectionItem::populate Create the childs of this item. More...
 

Private Attributes

QString m_path
 

Detailed Description

The FileElementCollectionItem class This class specialise ElementCollectionItem for manage a collection in a file system. They represente a directory or an element.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ FileElementCollectionItem()

FileElementCollectionItem::FileElementCollectionItem ( )

FileElementCollectionItem::FileElementCollectionItem Constructor.

Here is the caller graph for this function:

Member Function Documentation

◆ addChildAtPath()

void FileElementCollectionItem::addChildAtPath ( const QString &  collection_name)
overridevirtual

FileElementCollectionItem::addChildAtPath Ask to this item item to add a child with collection name collection_name.

Parameters
collection_name

Implements ElementCollectionItem.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collectionPath()

QString FileElementCollectionItem::collectionPath ( ) const
overridevirtual

FileElementCollectionItem::collectionPath.

Returns
The path of this item relative to the collection.

Implements ElementCollectionItem.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dirPath()

QString FileElementCollectionItem::dirPath ( ) const

FileElementCollectionItem::dirPath.

Returns
the dir path of this item (if this item is a dir return the path, if item is an element return the path of the parent directory)
Here is the call graph for this function:

◆ fileSystemPath()

QString FileElementCollectionItem::fileSystemPath ( ) const

FileElementCollectionItem::fileSystemPath.

Returns
the file system path of this item
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCollectionRoot()

bool FileElementCollectionItem::isCollectionRoot ( ) const
overridevirtual

FileElementCollectionItem::isCollectionRoot.

Returns
true if this item represent the root of collection

Implements ElementCollectionItem.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCommonCollection()

bool FileElementCollectionItem::isCommonCollection ( ) const

FileElementCollectionItem::isCommonCollection.

Returns
True if this item represent the common collection
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCustomCollection()

bool FileElementCollectionItem::isCustomCollection ( ) const

FileElementCollectionItem::isCustomCollection.

Returns
True if this item represent the custom collection
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDir()

bool FileElementCollectionItem::isDir ( ) const
overridevirtual

FileElementCollectionItem::isDir.

Returns
true if this item represent a directory

Implements ElementCollectionItem.

Here is the caller graph for this function:

◆ isElement()

bool FileElementCollectionItem::isElement ( ) const
overridevirtual

FileElementCollectionItem::isElement.

Returns
true if this item represent an element

Implements ElementCollectionItem.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ localName() [1/2]

QString FileElementCollectionItem::localName ( )
overridevirtual

FileElementCollectionItem::localName.

Returns
the located name of this item

Implements ElementCollectionItem.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ localName() [2/2]

QString FileElementCollectionItem::localName ( const ElementsLocation location)

FileElementCollectionItem::localName Surcharged method, unlike the default method, avoid to create an elementLocation and so, gain time.

Parameters
location
Returns
Here is the call graph for this function:

◆ name()

QString FileElementCollectionItem::name ( ) const
overridevirtual

FileElementCollectionItem::name.

Returns
The collection name of this item

Implements ElementCollectionItem.

Here is the call graph for this function:

◆ populate()

void FileElementCollectionItem::populate ( bool  set_data = true,
bool  hide_element = false 
)
private

FileElementCollectionItem::populate Create the childs of this item.

Parameters
set_data: if true, call setUpData for every child of this item
hide_element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPathName()

void FileElementCollectionItem::setPathName ( const QString &  path_name,
bool  set_data = true,
bool  hide_element = false 
)
private

FileElementCollectionItem::setPathName Set the name of this item in the file system path. This item must have a parent, because they should be a child item of another. For create a new file collection see setRootPath.

Parameters
path_name
set_data
hide_element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRootPath()

bool FileElementCollectionItem::setRootPath ( const QString &  path,
bool  set_data = true,
bool  hide_element = false 
)

FileElementCollectionItem::setRootPath Set path has root path for this file item. Use this function only to set the beginning of a file collection.

Parameters
path
set_data
hide_element
Returns
true if path exist.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpData()

void FileElementCollectionItem::setUpData ( )
overridevirtual

FileElementCollectionItem::setUpData SetUp the data of this item.

Implements ElementCollectionItem.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpIcon()

void FileElementCollectionItem::setUpIcon ( )
overridevirtual

FileElementCollectionItem::setUpIcon SetUp the icon of this item. Because icon use several memory, we use this method for setup icon instead setUpData.

Implements ElementCollectionItem.

Here is the call graph for this function:

◆ type()

int FileElementCollectionItem::type ( ) const
inlineoverride
Here is the caller graph for this function:

Member Data Documentation

◆ m_path

QString FileElementCollectionItem::m_path
private

The documentation for this class was generated from the following files: