QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
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.
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.
QString fileSystemPath () const
 FileElementCollectionItem::fileSystemPath.
QString dirPath () const
 FileElementCollectionItem::dirPath.
bool isDir () const override
 FileElementCollectionItem::isDir.
bool isElement () const override
 FileElementCollectionItem::isElement.
QString localName () override
 FileElementCollectionItem::localName.
QString localName (const ElementsLocation &location)
 FileElementCollectionItem::localName Surcharged method, unlike the default method, avoid to create an elementLocation and so, gain time.
QString name () const override
 FileElementCollectionItem::name.
QString collectionPath () const override
 FileElementCollectionItem::collectionPath.
bool isCollectionRoot () const override
 FileElementCollectionItem::isCollectionRoot.
bool isCommonCollection () const
 FileElementCollectionItem::isCommonCollection.
bool isCompanyCollection () const
 FileElementCollectionItem::isCompanyCollection.
bool isCustomCollection () const
 FileElementCollectionItem::isCustomCollection.
bool isMacrosCollection () const
 FileElementCollectionItem::isMacrosCollection.
void addChildAtPath (const QString &collection_name) override
 FileElementCollectionItem::addChildAtPath Ask to this item item to add a child with collection name collection_name.
void setUpData () override
 FileElementCollectionItem::setUpData SetUp the data of this item.
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.
Public Member Functions inherited from ElementCollectionItem
 ElementCollectionItem ()
 ElementCollectionItem::ElementCollectionItem Constructor.
int type () const override
virtual void clearData ()
 ElementCollectionItem::clearData Reset the data.
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.
ElementCollectionItemchildWithCollectionName (const QString &name) const
 ElementCollectionItem::childWithCollectionName Return the child with the collection name name, else return nullptr.
QList< QStandardItem * > directChilds () const
 ElementCollectionItem::directChilds Return the direct child of this item.
int rowForInsertItem (const QString &name)
 ElementCollectionItem::rowForInsertItem Return the row for insert a new child item to this item with name.
ElementCollectionItemitemAtPath (const QString &path)
 ElementCollectionItem::itemAtPath.
QList< ElementCollectionItem * > elementsDirectChild () const
 ElementCollectionItem::elementsDirectChild.
QList< ElementCollectionItem * > directoriesDirectChild () const
 ElementCollectionItem::directoriesDirectChild.
QList< ElementCollectionItem * > elementsChild () const
 ElementCollectionItem::elementsChild.
QList< ElementCollectionItem * > directoriesChild () const
 ElementCollectionItem::directoriesChild.
QList< ElementCollectionItem * > items () const
 ElementCollectionItem::items.

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.
void populate (bool set_data=true, bool hide_element=false)
 FileElementCollectionItem::populate Create the childs of this item.

Private Attributes

QString m_path
bool m_qet_directory_unreadable = false
bool m_icon_initialized = false

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:

◆ isCompanyCollection()

bool FileElementCollectionItem::isCompanyCollection ( ) const

FileElementCollectionItem::isCompanyCollection.

Returns
True if this item represent the company collection
Here is the call 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:

◆ isMacrosCollection()

bool FileElementCollectionItem::isMacrosCollection ( ) const

FileElementCollectionItem::isMacrosCollection.

Returns
True if this item represent the macros collection
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_icon_initialized

bool FileElementCollectionItem::m_icon_initialized = false
private

◆ m_path

QString FileElementCollectionItem::m_path
private

◆ m_qet_directory_unreadable

bool FileElementCollectionItem::m_qet_directory_unreadable = false
private

True when this directory's qet_directory file is missing or unreadable, so setUpData() can say so in the tooltip. Recorded rather than acted on in localName(), because setUpData() resets the tooltip afterwards and would otherwise discard it.


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