FMList

Search for usage in LXR

#include <fmlist.h>

Inheritance diagram for FMList:

Public Types

enum  FILTER : uint_fast8_t {
  AUDIO = FMStatic::FILTER_TYPE::AUDIO , VIDEO = FMStatic::FILTER_TYPE::VIDEO , TEXT = FMStatic::FILTER_TYPE::TEXT , IMAGE = FMStatic::FILTER_TYPE::IMAGE ,
  DOCUMENT = FMStatic::FILTER_TYPE::DOCUMENT , COMPRESSED = FMStatic::FILTER_TYPE::COMPRESSED , FONT = FMStatic::FILTER_TYPE::FONT , NONE = FMStatic::FILTER_TYPE::NONE
}
 
enum  PATHTYPE : uint_fast8_t {
  PLACES_PATH = FMStatic::PATHTYPE_KEY::PLACES_PATH , FISH_PATH = FMStatic::PATHTYPE_KEY::FISH_PATH , MTP_PATH = FMStatic::PATHTYPE_KEY::MTP_PATH , REMOTE_PATH = FMStatic::PATHTYPE_KEY::REMOTE_PATH ,
  DRIVES_PATH = FMStatic::PATHTYPE_KEY::DRIVES_PATH , REMOVABLE_PATH = FMStatic::PATHTYPE_KEY::REMOVABLE_PATH , TAGS_PATH = FMStatic::PATHTYPE_KEY::TAGS_PATH , BOOKMARKS_PATH = FMStatic::PATHTYPE_KEY::BOOKMARKS_PATH ,
  APPS_PATH = FMStatic::PATHTYPE_KEY::APPS_PATH , TRASH_PATH = FMStatic::PATHTYPE_KEY::TRASH_PATH , CLOUD_PATH = FMStatic::PATHTYPE_KEY::CLOUD_PATH , QUICK_PATH = FMStatic::PATHTYPE_KEY::QUICK_PATH ,
  OTHER_PATH = FMStatic::PATHTYPE_KEY::OTHER_PATH
}
 
enum  SORTBY : uint_fast8_t {
  SIZE = FMH::MODEL_KEY::SIZE , MODIFIED = FMH::MODEL_KEY::MODIFIED , DATE = FMH::MODEL_KEY::DATE , LABEL = FMH::MODEL_KEY::LABEL ,
  MIME = FMH::MODEL_KEY::MIME , ADDDATE = FMH::MODEL_KEY::ADDDATE
}
 
enum  VIEW_TYPE : uint_fast8_t { ICON_VIEW , LIST_VIEW }
 

Properties

QML_ELEMENTbool autoLoad
 
int cloudDepth = 1
 
QStringList filters = {}
 
FMList::FILTER filterType = FMList::FILTER::NONE
 
bool foldersFirst = false
 
bool hidden = false
 
bool onlyDirs = false
 
QUrl parentPath
 
QString path
 
QString pathName = QString()
 
FMList::PATHTYPE pathType = FMList::PATHTYPE::PLACES_PATH
 
bool readOnly
 
FMList::SORTBY sortBy
 
PathStatus status
 
- Properties inherited from MauiList
QML_ANONYMOUSint count
 
- Properties inherited from QObject
 objectName
 

Signals

void autoLoadChanged ()
 
void cloudDepthChanged ()
 
void filtersChanged ()
 
void filterTypeChanged ()
 
void foldersFirstChanged ()
 
void hiddenChanged ()
 
void onlyDirsChanged ()
 
void pathChanged ()
 
void pathNameChanged ()
 
void pathTypeChanged ()
 
void progress (int percent)
 
void readOnlyChanged ()
 
void sortByChanged ()
 
void statusChanged ()
 
void warning (QString message)
 
- Signals inherited from MauiList
void countChanged ()
 
void itemMoved (int index, int to)
 
void postItemAppended ()
 
void postItemRemoved ()
 
void postListChanged ()
 
void preItemAppended ()
 
void preItemAppendedAt (int index)
 
void preItemRemoved (int index)
 
void preItemsAppended (uint count)
 
void preListChanged ()
 
void updateModel (int index, QVector< int > roles)
 

Public Slots

bool clipboardHasContent () const
 
void copyInto (const QStringList &urls)
 
void createDir (const QString &name)
 
void createFile (const QString &name)
 
void createSymlink (const QString &url)
 
void cutInto (const QStringList &urls)
 
int indexOfFile (const QString &url)
 
int indexOfName (const QString &query)
 
void moveToTrash (const QStringList &urls)
 
void paste ()
 
const QUrl posteriorPath ()
 
const QUrl previousPath ()
 
void refresh ()
 
void remove (const int &index)
 
void removeFiles (const QStringList &urls)
 
void renameFile (const QString &url, const QString &newName)
 
void search (const QString &query, bool recursive=true)
 
void setDirIcon (const int &index, const QString &iconName)
 
- Public Slots inherited from MauiList
QVariantMap get (const int &index) const
 

Public Member Functions

 FMList (QObject *parent=nullptr)
 
bool getAutoLoad () const
 
int getCloudDepth () const
 
QStringList getFilters () const
 
FMList::FILTER getFilterType () const
 
bool getFoldersFirst () const
 
bool getHidden () const
 
bool getOnlyDirs () const
 
const QUrl getParentPath ()
 
QString getPath () const
 
QString getPathName () const
 
FMList::PATHTYPE getPathType () const
 
FMList::SORTBY getSortBy () const
 
PathStatus getStatus () const
 
const FMH::MODEL_LISTitems () const final override
 
bool readOnly () const
 
void resetFilters ()
 
void resetFilterType ()
 
void setAutoLoad (bool value)
 
void setCloudDepth (const int &value)
 
void setFilters (const QStringList &filters)
 
void setFilterType (const FMList::FILTER &type)
 
void setFoldersFirst (const bool &value)
 
void setHidden (const bool &state)
 
void setOnlyDirs (const bool &state)
 
void setPath (const QString &path)
 
void setReadOnly (bool value)
 
void setSortBy (const FMList::SORTBY &key)
 
- Public Member Functions inherited from MauiList
 MauiList (QObject *parent=nullptr)
 
virtual void classBegin () override
 
FMH::MODEL getItem (const int &index) const
 
virtual void modelHooked ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from MauiList
bool exists (const FMH::MODEL_KEY &key, const QString &value) const
 
int indexOf (const FMH::MODEL_KEY &key, const QString &value) const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

The FMList class Model for listing the file system files and directories and perform relevant actions upon it.

Definition at line 146 of file fmlist.h.

Member Enumeration Documentation

◆ FILTER

enum FMList::FILTER : uint_fast8_t

The possible values to filter the a location content by a mime-type.

Enumerator
AUDIO 

Audio file types.

Such as MP3, WAV, FLAC, MP4, etc.

VIDEO 

Video file types.

TEXT 

Plain text file types.

IMAGE 

Image file types.

DOCUMENT 

PDF, EBooks and comic books file types.

COMPRESSED 

Compressed archives.

FONT 

Font file types.

NONE 

Any file type.

Definition at line 277 of file fmlist.h.

◆ PATHTYPE

enum FMList::PATHTYPE : uint_fast8_t

The different location or places types.

Definition at line 323 of file fmlist.h.

◆ SORTBY

enum FMList::SORTBY : uint_fast8_t

The possible values to sort the location contents.

Enumerator
SIZE 

The size of the file entry.

MODIFIED 

The last modified date of the entry file.

DATE 

The creation date of the file entry.

LABEL 

The name or title of the file entry.

MIME 

The file type of the entry.

Deduced from its file suffix name

ADDDATE 

The date when the file entry was added.

Definition at line 241 of file fmlist.h.

◆ VIEW_TYPE

enum FMList::VIEW_TYPE : uint_fast8_t

The possible view types for listing the entries in the FileBrowser visual control.

Enumerator
ICON_VIEW 

Display the file system entries in a grid view.

LIST_VIEW 

Display the file system entries in a list, with more information details visible.

Definition at line 344 of file fmlist.h.

Property Documentation

◆ autoLoad

QML_ELEMENTbool FMList::autoLoad
readwrite

Whether to auto load the content entries when the path property is modified.

Otherwise explicitly call the load method.

See also
search
fill

Definition at line 159 of file fmlist.h.

◆ cloudDepth

int FMList::cloudDepth = 1
readwrite

When the location if a remote cloud directory, this allows to define the depth of the levels for listing the contents.

By default this is set to 1, which will only lists the entries in the current location, a bigger depth will start listing sub-directories too.

Deprecated

Definition at line 190 of file fmlist.h.

◆ filters

QStringList FMList::filters = {}
readwrite

The list of string values to filter the listing.

For example to only list PNG and JPG images: filters: ["*.png", "*.jpg"]. To reset or clear the filters you can set the property to undefined

Definition at line 196 of file fmlist.h.

◆ filterType

FMList::FILTER FMList::filterType = FMList::FILTER::NONE
readwrite

A convenient way to filter the location contents by a file type (mimetype).

By default this is set to FILTER_TYPE::NONE.

Definition at line 202 of file fmlist.h.

◆ foldersFirst

bool FMList::foldersFirst = false
readwrite

Whether the folders should be sorted first and then the files.

By default this is set to true.

Definition at line 183 of file fmlist.h.

◆ hidden

bool FMList::hidden = false
readwrite

Whether to list the hidden entries.

By default this is set to false.

Definition at line 171 of file fmlist.h.

◆ onlyDirs

bool FMList::onlyDirs = false
readwrite

Whether only directories should be listed.

By default this is set to false.

Definition at line 177 of file fmlist.h.

◆ parentPath

QUrl FMList::parentPath
read

The location of the parent directory of this current location.

Definition at line 235 of file fmlist.h.

◆ path

QString FMList::path
readwrite

The URL to location path to proceed listing all of its file entries.

There is support for multiple type of location depending on the scheme, for example local file system uses file://, while you can browser networks using ftp:// or fish://. Support for those locations depends on KIO and its slaves - to know more about it read the KIO slaves documentation.

Definition at line 165 of file fmlist.h.

◆ pathName

QString FMList::pathName = QString()
read

The title name of the current location.

Definition at line 220 of file fmlist.h.

◆ pathType

FMList::PATHTYPE FMList::pathType = FMList::PATHTYPE::PLACES_PATH
read

The known type of the current location.

Definition at line 225 of file fmlist.h.

◆ readOnly

bool FMList::readOnly
readwrite

Whether destructive actions or modifications can be done to the current location contents, such as deleting, renaming, pasting, adding, etc.

This only protects the location contents if using this API action methods.

Definition at line 214 of file fmlist.h.

◆ sortBy

FMList::SORTBY FMList::sortBy
readwrite

The sorting value.

By default this is set to SORTBY::MODIFIED.

Definition at line 208 of file fmlist.h.

◆ status

PathStatus FMList::status
read

The current status of the location contents listing.

This is a group of properties.

Definition at line 230 of file fmlist.h.

Constructor & Destructor Documentation

◆ FMList()

FMList::FMList ( QObject * parent = nullptr)

FMList.

Parameters
parent

Definition at line 37 of file fmlist.cpp.

Member Function Documentation

◆ clipboardHasContent

bool FMList::clipboardHasContent ( ) const
slot

Whether the clipboard has a supported type of content.

Returns
whether the clipboard content is a supported file URL or a text or image raw data.

Definition at line 584 of file fmlist.cpp.

◆ copyInto

void FMList::copyInto ( const QStringList & urls)
slot

Copy a list of file URLs into the current directory.

Parameters
urlslist of files

Definition at line 599 of file fmlist.cpp.

◆ createDir

void FMList::createDir ( const QString & name)
slot

Create a new directory within the current directory.

Parameters
namethe name of the directory

Definition at line 452 of file fmlist.cpp.

◆ createFile

void FMList::createFile ( const QString & name)
slot

Create a new file.

Note
To create a custom file, please supply with the correct suffix.
Parameters
namethe name of the new file, for example new.txt

Definition at line 466 of file fmlist.cpp.

◆ createSymlink

void FMList::createSymlink ( const QString & url)
slot

Create a symbolic link to the given URL in the current location.

Parameters
urlthe file URL to create the link from

Definition at line 498 of file fmlist.cpp.

◆ cutInto

void FMList::cutInto ( const QStringList & urls)
slot

Cut/move a list of file URLs to the current directory.

Parameters
urlslist of files

Definition at line 607 of file fmlist.cpp.

◆ getAutoLoad()

bool FMList::getAutoLoad ( ) const

Definition at line 824 of file fmlist.cpp.

◆ getCloudDepth()

int FMList::getCloudDepth ( ) const

Definition at line 775 of file fmlist.cpp.

◆ getFilters()

QStringList FMList::getFilters ( ) const

Definition at line 378 of file fmlist.cpp.

◆ getFilterType()

FMList::FILTER FMList::getFilterType ( ) const

Definition at line 398 of file fmlist.cpp.

◆ getFoldersFirst()

bool FMList::getFoldersFirst ( ) const

Definition at line 662 of file fmlist.cpp.

◆ getHidden()

bool FMList::getHidden ( ) const

Definition at line 418 of file fmlist.cpp.

◆ getOnlyDirs()

bool FMList::getOnlyDirs ( ) const

Definition at line 432 of file fmlist.cpp.

◆ getParentPath()

const QUrl FMList::getParentPath ( )

Definition at line 631 of file fmlist.cpp.

◆ getPath()

QString FMList::getPath ( ) const

Definition at line 316 of file fmlist.cpp.

◆ getPathName()

QString FMList::getPathName ( ) const

Definition at line 311 of file fmlist.cpp.

◆ getPathType()

FMList::PATHTYPE FMList::getPathType ( ) const

Definition at line 373 of file fmlist.cpp.

◆ getSortBy()

FMList::SORTBY FMList::getSortBy ( ) const

Definition at line 231 of file fmlist.cpp.

◆ getStatus()

PathStatus FMList::getStatus ( ) const

Definition at line 790 of file fmlist.cpp.

◆ indexOfFile

int FMList::indexOfFile ( const QString & url)
slot

Definition at line 854 of file fmlist.cpp.

◆ indexOfName

int FMList::indexOfName ( const QString & query)
slot

Given a file name query find if it exists in the current location.

Parameters
indexthe index of the found file entry otherwise -1

Definition at line 812 of file fmlist.cpp.

◆ items()

const FMH::MODEL_LIST & FMList::items ( ) const
finaloverridevirtual

items

Returns

Implements MauiList.

Definition at line 226 of file fmlist.cpp.

◆ moveToTrash

void FMList::moveToTrash ( const QStringList & urls)
slot

Remove and move to the trash the provided set of file URLs.

Parameters
urlsthe list of file URLS to be removed

Definition at line 482 of file fmlist.cpp.

◆ paste

void FMList::paste ( )
slot

Handle the paste action.

This allows to quickly paste into the current location any file URL in the clipboard, and raw image data and text snippets into a new file.

Definition at line 544 of file fmlist.cpp.

◆ posteriorPath

const QUrl FMList::posteriorPath ( )
slot

The immediate posterior path location that was navigated.

Returns
the path URL location

Definition at line 642 of file fmlist.cpp.

◆ previousPath

const QUrl FMList::previousPath ( )
slot

The immediate previous path location that was navigated.

Returns
the path URL location

Definition at line 652 of file fmlist.cpp.

◆ progress

void FMList::progress ( int percent)
signal

Emitted while the file listing is still in progress.

Parameters
percentthe loading progress - it goes from 0 to 100.

◆ readOnly()

bool FMList::readOnly ( ) const

Definition at line 840 of file fmlist.cpp.

◆ refresh

void FMList::refresh ( )
slot

Refresh the model for new changes.

h content listing ill be regenerated.

Definition at line 447 of file fmlist.cpp.

◆ remove

void FMList::remove ( const int & index)
slot

Remove an item from the model, this does not remove the file from the file system.

Parameters
indexthe index position of the file entry

Definition at line 801 of file fmlist.cpp.

◆ removeFiles

void FMList::removeFiles ( const QStringList & urls)
slot

Completely remove the set of file URLs provided.

This action can not be undone

Parameters
urlsthe list of file URLS to be removed

Definition at line 490 of file fmlist.cpp.

◆ renameFile

void FMList::renameFile ( const QString & url,
const QString & newName )
slot

Rename a file with from a given URL to the a new name provided.

Parameters
urlthe file URL to be renamed
newNamethe new name for the file

Definition at line 474 of file fmlist.cpp.

◆ resetFilters()

void FMList::resetFilters ( )

Definition at line 393 of file fmlist.cpp.

◆ resetFilterType()

void FMList::resetFilterType ( )

Definition at line 413 of file fmlist.cpp.

◆ search

void FMList::search ( const QString & query,
bool recursive = true )
slot

Start a search - starting from the current location - for a given name query.

Parameters
querythe search query name
recursivewhether the search should be recursive and look into the subsequent sub-directories structure. By default this is set to false.

Definition at line 709 of file fmlist.cpp.

◆ setAutoLoad()

void FMList::setAutoLoad ( bool value)

Definition at line 829 of file fmlist.cpp.

◆ setCloudDepth()

void FMList::setCloudDepth ( const int & value)

Definition at line 780 of file fmlist.cpp.

◆ setDirIcon

void FMList::setDirIcon ( const int & index,
const QString & iconName )
slot

Changes the icon of a directory by making use of the directory config file.

Parameters
indexthe index position of the directory in the model
iconNamethen name of the new icon

Definition at line 615 of file fmlist.cpp.

◆ setFilters()

void FMList::setFilters ( const QStringList & filters)

Definition at line 383 of file fmlist.cpp.

◆ setFilterType()

void FMList::setFilterType ( const FMList::FILTER & type)

Definition at line 403 of file fmlist.cpp.

◆ setFoldersFirst()

void FMList::setFoldersFirst ( const bool & value)

Definition at line 667 of file fmlist.cpp.

◆ setHidden()

void FMList::setHidden ( const bool & state)

Definition at line 423 of file fmlist.cpp.

◆ setOnlyDirs()

void FMList::setOnlyDirs ( const bool & state)

Definition at line 437 of file fmlist.cpp.

◆ setPath()

void FMList::setPath ( const QString & path)

Definition at line 321 of file fmlist.cpp.

◆ setReadOnly()

void FMList::setReadOnly ( bool value)

Definition at line 845 of file fmlist.cpp.

◆ setSortBy()

void FMList::setSortBy ( const FMList::SORTBY & key)

Definition at line 236 of file fmlist.cpp.

◆ warning

void FMList::warning ( QString message)
signal

Emitted when the listing process has any error message that needs to be notified.

Parameters
messagethe warning message text

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:51:27 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.