FMStatic

Search for usage in LXR

#include <fmstatic.h>

Inheritance diagram for FMStatic:

Classes

struct  PATH_CONTENT
 

Public Types

enum  FILTER_TYPE : int {
  AUDIO , VIDEO , TEXT , IMAGE ,
  DOCUMENT , COMPRESSED , FONT , NONE
}
 
enum  PATHTYPE_KEY : int {
  PLACES_PATH , REMOTE_PATH , DRIVES_PATH , REMOVABLE_PATH ,
  TAGS_PATH , UNKNOWN_TYPE , APPS_PATH , TRASH_PATH ,
  SEARCH_PATH , CLOUD_PATH , FISH_PATH , MTP_PATH ,
  QUICK_PATH , BOOKMARKS_PATH , OTHER_PATH
}
 
- Public Types inherited from QObject
typedef  QObjectList
 

Public Slots

static void bookmark (const QUrl &url)
 
static bool checkFileType (const FMStatic::FILTER_TYPE &type, const QString &mimeTypeName)
 
static bool checkFileType (const int &type, const QString &mimeTypeName)
 
static bool copy (const QList< QUrl > &urls, const QUrl &destinationDir)
 
static bool createDir (const QUrl &path, const QString &name)
 
static bool createFile (const QUrl &path, const QString &name)
 
static bool createSymlink (const QUrl &path, const QUrl &where)
 
static bool cut (const QList< QUrl > &urls, const QUrl &where)
 
static bool cut (const QList< QUrl > &urls, const QUrl &where, const QString &name)
 
static const QString dirConfIcon (const QUrl &path)
 
static void emptyTrash ()
 
static QUrl fileDir (const QUrl &path)
 
static bool fileExists (const QUrl &path)
 
static FMH::MODEL_LIST getDefaultPaths ()
 
static FMH::MODEL_LIST getDevices ()
 
static const QVariantMap getFileInfo (const QUrl &path)
 
static const FMH::MODEL getFileInfoModel (const QUrl &path)
 
static const QString getIconName (const QUrl &path)
 
static const QString getMime (const QUrl &path)
 
static FMStatic::PATHTYPE_KEY getPathType (const QUrl &url)
 
static bool group (const QList< QUrl > &urls, const QUrl &destinationDir, const QString &name)
 
static QString homePath ()
 
static bool isCloud (const QUrl &path)
 
static bool isDefaultPath (const QString &path)
 
static bool isDir (const QUrl &path)
 
static void moveToTrash (const QList< QUrl > &urls)
 
static QStringList nameFilters (const int &type)
 
static void openLocation (const QStringList &urls)
 
static void openUrl (const QUrl &url)
 
static FMH::MODEL_LIST packItems (const QStringList &items, const QString &type)
 
static QUrl parentDir (const QUrl &path)
 
static bool removeDir (const QUrl &path)
 
static bool removeFiles (const QList< QUrl > &urls)
 
static bool rename (const QUrl &url, const QString &name)
 
static FMH::MODEL_LIST search (const QString &query, const QUrl &path, const bool &hidden=false, const bool &onlyDirs=false, const QStringList &filters=QStringList())
 
static void setDirConf (const QUrl &path, const QString &group, const QString &key, const QVariant &value)
 

Static Public Member Functions

static QStringList getMimeTypeSuffixes (const FILTER_TYPE &type, QString(*cb)(QString)=nullptr)
 
static QString PathTypeLabel (const FMStatic::PATHTYPE_KEY &key)
 
- 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)
 

Static Public Attributes

static const QString AppsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).toString()
 
static const QStringList AUDIO_MIMETYPES
 
static const QString CloudCachePath = DataPath + QStringLiteral("/Cloud/")
 
static const QStringList COMPRESSED_MIMETYPES
 
static const QString ConfigPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)).toString()
 
static const QString DataPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
 
static const QStringList defaultPaths
 
static const QString DesktopPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).toString()
 
static const QStringList DOCUMENT_MIMETYPES
 
static const QString DocumentsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString()
 
static const QString DownloadsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).toString()
 
static QHash< FILTER_TYPE, QStringListFILTER_LIST
 
static const QMap< QString, QStringfolderIcon
 
static const QStringList FONT_MIMETYPES
 
static const QString HomePath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)).toString()
 
static const QStringList IMAGE_MIMETYPES
 
static const QString MusicPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MusicLocation)).toString()
 
static const QHash< PATHTYPE_KEY, QStringPATHTYPE_SCHEME
 
static const QHash< QString, PATHTYPE_KEYPATHTYPE_SCHEME_NAME
 
static const QHash< PATHTYPE_KEY, QStringPATHTYPE_URI
 
static const QString PicturesPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)).toString()
 
static const QString RootPath = QUrl::fromLocalFile(QStringLiteral("/")).toString()
 
static const QMap< FILTER_TYPE, QStringListSUPPORTED_MIMETYPES
 
static const QStringList TEXT_MIMETYPES
 
static const QString TrashPath = QStringLiteral("trash:/")
 
static const QStringList VIDEO_MIMETYPES
 
static const QString VideosPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)).toString()
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- 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
 
- 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 FMStatic class is a group of static file management methods, this class has a constructor only as a way to register it to QML, however all methods in here are static.

Definition at line 29 of file fmstatic.h.

Member Enumeration Documentation

◆ FILTER_TYPE

The common file types for filtering.

Definition at line 46 of file fmstatic.h.

◆ PATHTYPE_KEY

The different location types supported. Most of them need of KDE KIO framework to be fully operational.

Enumerator
PLACES_PATH 

Local paths, such as the Downloads, Pictures, etc.

file:/

REMOTE_PATH 

Remote locations, such as servers accessed via SSH or FTP.

DRIVES_PATH 

Hard drives locations.

REMOVABLE_PATH 

Removable places, such as optic CDs, USB pen drives, etc.

TAGS_PATH 

A tag location.

UNKNOWN_TYPE 

Unknown location type.

APPS_PATH 

The applications location.

Accessed with KIO via the applications:// scheme.

TRASH_PATH 

The trash location.

trash:/

SEARCH_PATH 

A search results.

CLOUD_PATH 

A remote cloud server path.

FISH_PATH 

A remote SHH or FTP.

fish:/ ftp:/

MTP_PATH 

MTP path.

QUICK_PATH 

The common standard paths.

BOOKMARKS_PATH 

A bookmarked location.

file:/

OTHER_PATH 

Any other path.

Definition at line 252 of file fmstatic.h.

Member Function Documentation

◆ bookmark

void FMStatic::bookmark ( const QUrl & url)
staticslot

Add a directory URL to the places bookmarks.

Parameters
urlthe directory URL to be bookmarked

Definition at line 496 of file fmstatic.cpp.

◆ checkFileType [1/2]

bool FMStatic::checkFileType ( const FMStatic::FILTER_TYPE & type,
const QString & mimeTypeName )
staticslot

Definition at line 491 of file fmstatic.cpp.

◆ checkFileType [2/2]

bool FMStatic::checkFileType ( const int & type,
const QString & mimeTypeName )
staticslot

Checks if a mime-type belongs to a file type, for example, whether image/jpg belongs to the type FMH::FILTER_TYPE

Parameters
typeFMH::FILTER_TYPE value
mimeTypeNamethe mime type name
Returns
whether the type contains the given name

Definition at line 486 of file fmstatic.cpp.

◆ copy

bool FMStatic::copy ( const QList< QUrl > & urls,
const QUrl & destinationDir )
staticslot

Perform a copy of the files to the given destination.

Parameters
urlslist of URLs to be copy
destinationDirdestination
Returns
whether the operation has been successful

Definition at line 216 of file fmstatic.cpp.

◆ createDir

bool FMStatic::createDir ( const QUrl & path,
const QString & name )
staticslot

Creates a new directory given a base path and a name.

Parameters
pathbase path where to create the new directory
namethe new directory name
Returns
whether the operation was successful

Definition at line 371 of file fmstatic.cpp.

◆ createFile

bool FMStatic::createFile ( const QUrl & path,
const QString & name )
staticslot

Creates a file given the base directory path and a file name.

Parameters
paththe base location path
namethe name of the new file to be created with the extension
Returns
whether the operation was successful

Definition at line 382 of file fmstatic.cpp.

◆ createSymlink

bool FMStatic::createSymlink ( const QUrl & path,
const QUrl & where )
staticslot

Creates a symbolic link to a given file URL.

Parameters
pathfile to be linked
wheredestination of the symbolic link
Returns
whether the operation was successful

Definition at line 394 of file fmstatic.cpp.

◆ cut [1/2]

bool FMStatic::cut ( const QList< QUrl > & urls,
const QUrl & where )
staticslot

Perform a move/cut of a list of files to a destination.

This function also moves the associated tags.

Parameters
urlslist of URLs to be moved
wheredestination path
Returns
whether the operation has been successful

Definition at line 256 of file fmstatic.cpp.

◆ cut [2/2]

bool FMStatic::cut ( const QList< QUrl > & urls,
const QUrl & where,
const QString & name )
staticslot
See also
cut
Parameters
namenew name of the directory where the files will be pasted

Definition at line 261 of file fmstatic.cpp.

◆ dirConfIcon

const QString FMStatic::dirConfIcon ( const QUrl & path)
staticslot

Return the icon name set in the directory .directory conf file.

The passed path must be a local file URL.

Parameters
paththe directory location
Returns
the icon name

Definition at line 437 of file fmstatic.cpp.

◆ emptyTrash

void FMStatic::emptyTrash ( )
staticslot

Empty the trashcan.

Definition at line 333 of file fmstatic.cpp.

◆ fileDir

QUrl FMStatic::fileDir ( const QUrl & path)
staticslot

Given a file URL, return its parent directory.

Note
If the given path is a directory then returns the same path.
Parameters
pathfile path URL
Returns
the directory URL

Definition at line 160 of file fmstatic.cpp.

◆ fileExists

bool FMStatic::fileExists ( const QUrl & path)
staticslot

Checks if a local file exists in the file system.

Parameters
pathfile URL
Returns
whether the file path exists locally

Definition at line 155 of file fmstatic.cpp.

◆ getDefaultPaths

FMH::MODEL_LIST FMStatic::getDefaultPaths ( )
staticslot

A model list of the default paths in most systems, such as Home, Pictures, Video, Downloads, Music and Documents folders.

Returns
the packaged model with information for each directory

Definition at line 74 of file fmstatic.cpp.

◆ getDevices

FMH::MODEL_LIST FMStatic::getDevices ( )
staticslot

Devices mounted in the file system.

Returns
list of devices represented as a FMH::MODEL_LIST with information

Definition at line 110 of file fmstatic.cpp.

◆ getFileInfo

const QVariantMap FMStatic::getFileInfo ( const QUrl & path)
staticslot

getFileInfo

Parameters
path
Returns

Definition at line 613 of file fmstatic.cpp.

◆ getFileInfoModel

const FMH::MODEL FMStatic::getFileInfoModel ( const QUrl & path)
staticslot

getFileInfoModel

Parameters
path
Returns

Definition at line 560 of file fmstatic.cpp.

◆ getIconName

const QString FMStatic::getIconName ( const QUrl & path)
staticslot

Returns the icon name for certain file.

The file path must be represented as a local file URL. It also looks into the directory conf file to get the directory custom icon.

Note
To get an abstract icon, use a template name, such as test.jpg, to get an icon for the JPG image type. The file does not need to exists.
Parameters
pathfile path
Returns

Definition at line 618 of file fmstatic.cpp.

◆ getMime

const QString FMStatic::getMime ( const QUrl & path)
staticslot

Get the mime type of the given file path.

Parameters
paththe file path
Returns
the mime-type string

Definition at line 506 of file fmstatic.cpp.

◆ getMimeTypeSuffixes()

static QStringList FMStatic::getMimeTypeSuffixes ( const FILTER_TYPE & type,
QString(* cb )(QString) = nullptr )
inlinestatic

Given a FILTER_TYPE and its associated mime-types, return a list of all the supported file extension suffixes.

Parameters
typethe FILTER_TYPE
cba callback function to modify the gathered suffix extension. This function will receive the supported suffix and it can return a new string of a modified suffix or the same one. This is optional.
Returns
the list of associated file extensions

Definition at line 185 of file fmstatic.h.

◆ getPathType

FMStatic::PATHTYPE_KEY FMStatic::getPathType ( const QUrl & url)
staticslot

Given a file URL with a well defined scheme, get the PATHTYPE_KEY.

See also
PATHTYPE_KEY
Parameters
urlthe file URL
Returns
the file PATHTYPE_KEY

Definition at line 646 of file fmstatic.cpp.

◆ group

bool FMStatic::group ( const QList< QUrl > & urls,
const QUrl & destinationDir,
const QString & name )
staticslot

Perform a move operation of the given files to a new destination.

Parameters
urlslist of URLs to be copied
destinationDirdestination
namethe name of the new directory where all the entries will be grouped/moved into
Returns
whether the operation has been successful

Definition at line 244 of file fmstatic.cpp.

◆ homePath

QString FMStatic::homePath ( )
staticslot

The default home path.

Returns
URL of the home location

Definition at line 175 of file fmstatic.cpp.

◆ isCloud

bool FMStatic::isCloud ( const QUrl & path)
staticslot

Whether a path is a URL server instead of a local file.

Parameters
path
Returns

Definition at line 150 of file fmstatic.cpp.

◆ isDefaultPath

bool FMStatic::isDefaultPath ( const QString & path)
staticslot

Checks if a given path URL is a default path as found in the defaultPaths method.

Parameters
paththe directory location path
Returns
whether is a default path

Definition at line 122 of file fmstatic.cpp.

◆ isDir

bool FMStatic::isDir ( const QUrl & path)
staticslot

Whether a local file URL is a directory.

Parameters
pathfile URL
Returns
is a directory

Definition at line 139 of file fmstatic.cpp.

◆ moveToTrash

void FMStatic::moveToTrash ( const QList< QUrl > & urls)
staticslot

Moves to the trashcan the provided file URLs.

The associated tags are kept in case the files are restored.

Parameters
urlsthe file URLs

Definition at line 323 of file fmstatic.cpp.

◆ nameFilters

QStringList FMStatic::nameFilters ( const int & type)
staticslot

Given a filter type return a list of associated name filters, as their suffixes.

Parameters
typethe filter type to be mapped to a FMH::FILTER_TYPE
See also
FMH::FILTER_LIST

Definition at line 501 of file fmstatic.cpp.

◆ openLocation

void FMStatic::openLocation ( const QStringList & urls)
staticslot

Open the file URLs with the default file manager.

Parameters
urlsfile or location URLs to be opened

Definition at line 423 of file fmstatic.cpp.

◆ openUrl

void FMStatic::openUrl ( const QUrl & url)
staticslot

Given a URL it tries to open it using the default application associated to it.

Parameters
urlthe file URL to be opened

Definition at line 406 of file fmstatic.cpp.

◆ packItems

FMH::MODEL_LIST FMStatic::packItems ( const QStringList & items,
const QString & type )
staticslot

Given a list of path URLs pack all the info of such files as a FMH::MODEL_LIST.

Parameters
itemslist of local URLs
typethe type of the list of URLs, such as local, remote etc. This value is inserted with the key FMH::MODEL_KEY::TYPE
Returns

Definition at line 57 of file fmstatic.cpp.

◆ parentDir

QUrl FMStatic::parentDir ( const QUrl & path)
staticslot

Given a file URL return its parent directory.

Parameters
paththe file URL
Returns
the parent directory URL if it exists otherwise returns the passed URL

Definition at line 127 of file fmstatic.cpp.

◆ PathTypeLabel()

QString FMStatic::PathTypeLabel ( const FMStatic::PATHTYPE_KEY & key)
static

Given a PATHTYPE_KEY return a user friendly string.

Warning
This is a user visible and translatable string, so it should not be used as a key anywhere
Parameters
keythe PATHTYPE_KEY key

Definition at line 31 of file fmstatic.cpp.

◆ removeDir

bool FMStatic::removeDir ( const QUrl & path)
staticslot

Remove a directory recursively.

Parameters
pathdirectory URL to be removed
Returns
whether the operation has been sucessfull

Definition at line 341 of file fmstatic.cpp.

◆ removeFiles

bool FMStatic::removeFiles ( const QList< QUrl > & urls)
staticslot

List of files to be removed completely.

This function also removes the associated tags to the files.

Parameters
urlsfile URLs to be removed
Returns
Whether the operation has been sucessfull

Definition at line 296 of file fmstatic.cpp.

◆ rename

bool FMStatic::rename ( const QUrl & url,
const QString & name )
staticslot

Rename a file.

The associated tags will be updated.

Parameters
urlthe file URL to be renamed
namethe new name of the file, not the new URL, for setting a new URl use cut instead.
Returns
whether the operation was successful.

Definition at line 366 of file fmstatic.cpp.

◆ search

FMH::MODEL_LIST FMStatic::search ( const QString & query,
const QUrl & path,
const bool & hidden = false,
const bool & onlyDirs = false,
const QStringList & filters = QStringList() )
staticslot

Search for files in a path using name filters.

Parameters
querythe term query to be searched, such as ".qml" or "music"
paththe path where to perform or start the search
hiddenwhether to search for hidden files
onlyDirswhether to only search for directories and not files
filterslist of filter patterns such as {"*.qml"}, it can use regular expressions.
Returns
the search results are returned as a FMH::MODEL_LIST

Definition at line 79 of file fmstatic.cpp.

◆ setDirConf

void FMStatic::setDirConf ( const QUrl & path,
const QString & group,
const QString & key,
const QVariant & value )
staticslot

Write a configuration key-value entry to the directory conf file.

Parameters
pathdirectory path
groupthe entry group name
keythe key name of the entry
valuethe value of the entry

Definition at line 464 of file fmstatic.cpp.

Member Data Documentation

◆ AppsPath

Standard applications location path

Definition at line 404 of file fmstatic.h.

◆ AUDIO_MIMETYPES

const QStringList FMStatic::AUDIO_MIMETYPES
inlinestatic
Initial value:
= {
QStringLiteral("audio/mpeg"),
QStringLiteral("audio/mp4"),
QStringLiteral("audio/flac"),
QStringLiteral("audio/ogg"),
QStringLiteral("audio/wav")}

The list of supported audio formats, associated to FILTER_TYPE::AUDIO

Definition at line 51 of file fmstatic.h.

◆ CloudCachePath

const QString FMStatic::CloudCachePath = DataPath + QStringLiteral("/Cloud/")
inlinestatic

Standard Cloud Cache location path

Definition at line 398 of file fmstatic.h.

◆ COMPRESSED_MIMETYPES

const QStringList FMStatic::COMPRESSED_MIMETYPES
inlinestatic
Initial value:
= {
QStringLiteral("application/x-compress"),
QStringLiteral("application/x-compressed"),
QStringLiteral("application/x-xz-compressed-tar"),
QStringLiteral("application/x-compressed-tar"),
QStringLiteral("application/x-xz"),
QStringLiteral("application/x-bzip"),
QStringLiteral("application/x-gtar"),
QStringLiteral("application/x-gzip"),
QStringLiteral("application/zip")}

The list of supported archive formats, associated to FILTER_TYPE::COMPRESSED

Definition at line 148 of file fmstatic.h.

◆ ConfigPath

const QString FMStatic::ConfigPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)).toString()
inlinestatic

Standard Configuration location path

Definition at line 395 of file fmstatic.h.

◆ DataPath

Standard Data location path

Definition at line 392 of file fmstatic.h.

◆ defaultPaths

const QStringList FMStatic::defaultPaths
inlinestatic
Initial value:
= {
DocumentsPath,
DownloadsPath,
MusicPath,
PicturesPath,
VideosPath,
}
static const QString RootPath
Standard root location path
Definition fmstatic.h:407
static const QString HomePath
Standard home location path
Definition fmstatic.h:430
static const QString DesktopPath
Standard desktop location path
Definition fmstatic.h:401

The internally defined quick standard locations.

Definition at line 441 of file fmstatic.h.

◆ DesktopPath

const QString FMStatic::DesktopPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).toString()
inlinestatic

Standard desktop location path

Definition at line 401 of file fmstatic.h.

◆ DOCUMENT_MIMETYPES

const QStringList FMStatic::DOCUMENT_MIMETYPES
inlinestatic
Initial value:
= {
QStringLiteral("application/pdf"),
QStringLiteral("application/rtf"),
QStringLiteral("application/doc"),
QStringLiteral("application/odf"),
QStringLiteral("application/vnd.comicbook+zip"),
QStringLiteral("application/vnd.comicbook+rar")}

The list of supported document formats, associated to FILTER_TYPE::DOCUMENT

Definition at line 137 of file fmstatic.h.

◆ DocumentsPath

const QString FMStatic::DocumentsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString()
inlinestatic

Definition at line 434 of file fmstatic.h.

◆ DownloadsPath

const QString FMStatic::DownloadsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).toString()
inlinestatic

Definition at line 433 of file fmstatic.h.

◆ FILTER_LIST

QHash<FILTER_TYPE, QStringList> FMStatic::FILTER_LIST
inlinestatic
Initial value:
= {{FILTER_TYPE::AUDIO,
getMimeTypeSuffixes(FILTER_TYPE::AUDIO,
func)},
{FILTER_TYPE::VIDEO,
getMimeTypeSuffixes(FILTER_TYPE::VIDEO,
func)},
{FILTER_TYPE::TEXT,
getMimeTypeSuffixes(FILTER_TYPE::TEXT,
func)},
{FILTER_TYPE::DOCUMENT,
getMimeTypeSuffixes(FILTER_TYPE::DOCUMENT,
func)},
{FILTER_TYPE::COMPRESSED,
getMimeTypeSuffixes(FILTER_TYPE::COMPRESSED,
func)},
{FILTER_TYPE::FONT,
getMimeTypeSuffixes(FILTER_TYPE::FONT,
func)},
{FILTER_TYPE::IMAGE,
getMimeTypeSuffixes(FILTER_TYPE::IMAGE,
func)},
{FILTER_TYPE::NONE, QStringList()}}
static QStringList getMimeTypeSuffixes(const FILTER_TYPE &type, QString(*cb)(QString)=nullptr)
Given a FILTER_TYPE and its associated mime-types, return a list of all the supported file extension ...
Definition fmstatic.h:185

Convenient map set of file type extensions.

The values make use of the regex wildcard operator [*] meant for filtering a directory contents, for example. FILTER_LIST[FILTER_TYPE::AUDIO] could possible return something alike ["*.mp3", "*.mp4", "*.mpeg", "*.wav"] etc.

Definition at line 214 of file fmstatic.h.

◆ folderIcon

const QMap<QString, QString> FMStatic::folderIcon
inlinestatic
Initial value:
{{PicturesPath, QStringLiteral("folder-pictures")},
{DownloadsPath, QStringLiteral("folder-download")},
{DocumentsPath, QStringLiteral("folder-documents")},
{HomePath, QStringLiteral("user-home")},
{MusicPath, QStringLiteral("folder-music")},
{VideosPath, QStringLiteral("folder-videos")},
{DesktopPath, QStringLiteral("user-desktop")},
{AppsPath, QStringLiteral("system-run")},
{RootPath, QStringLiteral("folder-root")}}
static const QString AppsPath
Standard applications location path
Definition fmstatic.h:404

A mapping of the standard location to a icon name.

Definition at line 457 of file fmstatic.h.

◆ FONT_MIMETYPES

const QStringList FMStatic::FONT_MIMETYPES
inlinestatic
Initial value:
= {
QStringLiteral("font/ttf"),
QStringLiteral("font/otf")}

The list of supported font formats, associated to FILTER_TYPE::FONT

Definition at line 163 of file fmstatic.h.

◆ HomePath

const QString FMStatic::HomePath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)).toString()
inlinestatic

Standard home location path

Definition at line 430 of file fmstatic.h.

◆ IMAGE_MIMETYPES

const QStringList FMStatic::IMAGE_MIMETYPES
inlinestatic
Initial value:
= {
QStringLiteral("image/bmp"),
QStringLiteral("image/webp"),
QStringLiteral("image/png"),
QStringLiteral("image/gif"),
QStringLiteral("image/jpeg"),
QStringLiteral("image/web"),
QStringLiteral("image/svg"),
QStringLiteral("image/svg+xml"),
QStringLiteral("application/x-krita"),
QStringLiteral("image/x-xcf"),
QStringLiteral("image/vnd.adobe.photoshop"),
QStringLiteral("image/x-eps"),
QStringLiteral("image/jxl"),
QStringLiteral("image/avif")}

The list of supported image formats, associated to FILTER_TYPE::IMAGE

Definition at line 118 of file fmstatic.h.

◆ MusicPath

const QString FMStatic::MusicPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MusicLocation)).toString()
inlinestatic

Definition at line 431 of file fmstatic.h.

◆ PATHTYPE_SCHEME

const QHash<PATHTYPE_KEY, QString> FMStatic::PATHTYPE_SCHEME
inlinestatic
Initial value:
= {{PATHTYPE_KEY::PLACES_PATH, QStringLiteral("file")},
{PATHTYPE_KEY::BOOKMARKS_PATH, QStringLiteral("file")},
{PATHTYPE_KEY::DRIVES_PATH, QStringLiteral("drives")},
{PATHTYPE_KEY::APPS_PATH, QStringLiteral("applications")},
{PATHTYPE_KEY::REMOTE_PATH, QStringLiteral("remote")},
{PATHTYPE_KEY::REMOVABLE_PATH, QStringLiteral("removable")},
{PATHTYPE_KEY::UNKNOWN_TYPE, QStringLiteral("unknown")},
{PATHTYPE_KEY::TRASH_PATH, QStringLiteral("trash")},
{PATHTYPE_KEY::TAGS_PATH, QStringLiteral("tags")},
{PATHTYPE_KEY::SEARCH_PATH, QStringLiteral("search")},
{PATHTYPE_KEY::CLOUD_PATH, QStringLiteral("cloud")},
{PATHTYPE_KEY::FISH_PATH, QStringLiteral("fish")},
{PATHTYPE_KEY::MTP_PATH, QStringLiteral("mtp")}}
@ REMOTE_PATH
Remote locations, such as servers accessed via SSH or FTP.
Definition fmstatic.h:261
@ UNKNOWN_TYPE
Unknown location type.
Definition fmstatic.h:281
@ FISH_PATH
A remote SHH or FTP.
Definition fmstatic.h:306
@ APPS_PATH
The applications location.
Definition fmstatic.h:286
@ TAGS_PATH
A tag location.
Definition fmstatic.h:276
@ SEARCH_PATH
A search results.
Definition fmstatic.h:296
@ DRIVES_PATH
Hard drives locations.
Definition fmstatic.h:266
@ MTP_PATH
MTP path.
Definition fmstatic.h:311
@ CLOUD_PATH
A remote cloud server path.
Definition fmstatic.h:301
@ TRASH_PATH
The trash location.
Definition fmstatic.h:291
@ BOOKMARKS_PATH
A bookmarked location.
Definition fmstatic.h:321
@ REMOVABLE_PATH
Removable places, such as optic CDs, USB pen drives, etc.
Definition fmstatic.h:271
@ PLACES_PATH
Local paths, such as the Downloads, Pictures, etc.
Definition fmstatic.h:256

The map of the PATH_TYPE to its associated protocol scheme.

For example PATHTYPE_SCHEME[PATHTYPE_KEY::TRASH_PATH] = "trash", PATHTYPE_SCHEME[PATHTYPE_KEY::PLACES_PATH] = "file"

Definition at line 333 of file fmstatic.h.

◆ PATHTYPE_SCHEME_NAME

◆ PATHTYPE_URI

const QHash<PATHTYPE_KEY, QString> FMStatic::PATHTYPE_URI
inlinestatic
Initial value:

Similar to PATHTYPE_SCHEME, but mapped with the complete scheme.

For example PATHTYPE_URIE[PATHTYPE_KEY::TRASH_PATH] = "trash://", PATHTYPE_URI[PLACES_PATH] = "file://"

Definition at line 369 of file fmstatic.h.

◆ PicturesPath

const QString FMStatic::PicturesPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)).toString()
inlinestatic

Definition at line 432 of file fmstatic.h.

◆ RootPath

const QString FMStatic::RootPath = QUrl::fromLocalFile(QStringLiteral("/")).toString()
inlinestatic

Standard root location path

Definition at line 407 of file fmstatic.h.

◆ SUPPORTED_MIMETYPES

const QMap<FILTER_TYPE, QStringList> FMStatic::SUPPORTED_MIMETYPES
inlinestatic
Initial value:
{{FILTER_TYPE::AUDIO, AUDIO_MIMETYPES},
{FILTER_TYPE::VIDEO, VIDEO_MIMETYPES},
{FILTER_TYPE::TEXT, TEXT_MIMETYPES},
{FILTER_TYPE::IMAGE, IMAGE_MIMETYPES},
{FILTER_TYPE::DOCUMENT, DOCUMENT_MIMETYPES},
{FILTER_TYPE::FONT, FONT_MIMETYPES},
{FILTER_TYPE::COMPRESSED, COMPRESSED_MIMETYPES}}
static const QStringList VIDEO_MIMETYPES
The list of supported video formats, associated to FILTER_TYPE::VIDEO
Definition fmstatic.h:61
static const QStringList AUDIO_MIMETYPES
The list of supported audio formats, associated to FILTER_TYPE::AUDIO
Definition fmstatic.h:51
static const QStringList IMAGE_MIMETYPES
The list of supported image formats, associated to FILTER_TYPE::IMAGE
Definition fmstatic.h:118
static const QStringList FONT_MIMETYPES
The list of supported font formats, associated to FILTER_TYPE::FONT
Definition fmstatic.h:163
static const QStringList DOCUMENT_MIMETYPES
The list of supported document formats, associated to FILTER_TYPE::DOCUMENT
Definition fmstatic.h:137
static const QStringList TEXT_MIMETYPES
The list of supported text formats, associated to FILTER_TYPE::TEXT
Definition fmstatic.h:79
static const QStringList COMPRESSED_MIMETYPES
The list of supported archive formats, associated to FILTER_TYPE::COMPRESSED
Definition fmstatic.h:148

The map set of the supported mime types for the FM classes.

This structure maps the FILTER_TYPE to the associated list of mime types.

  • For example SUPPORTED_MIMETYPES[FILTER_TYPE::AUDIO] would return a list of mimetypes associated to the FILTER_TYPE::AUDIO, such as "audio/mpeg", "audio/mp4", "audio/flac", "audio/ogg", "audio/wav".

Definition at line 171 of file fmstatic.h.

◆ TEXT_MIMETYPES

const QStringList FMStatic::TEXT_MIMETYPES
inlinestatic

The list of supported text formats, associated to FILTER_TYPE::TEXT

Definition at line 79 of file fmstatic.h.

◆ TrashPath

const QString FMStatic::TrashPath = QStringLiteral("trash:/")
inlinestatic

Standard trash location path

Definition at line 438 of file fmstatic.h.

◆ VIDEO_MIMETYPES

const QStringList FMStatic::VIDEO_MIMETYPES
inlinestatic
Initial value:
= {
QStringLiteral("video/mp4"),
QStringLiteral("video/x-matroska"),
QStringLiteral("video/webm"),
QStringLiteral("video/avi"),
QStringLiteral("video/flv"),
QStringLiteral("video/mpg"),
QStringLiteral("video/wmv"),
QStringLiteral("video/mov"),
QStringLiteral("video/quicktime"),
QStringLiteral("video/ogg"),
QStringLiteral("video/x-flv"),
QStringLiteral("video/mpeg"),
QStringLiteral("video/jpeg")}

The list of supported video formats, associated to FILTER_TYPE::VIDEO

Definition at line 61 of file fmstatic.h.

◆ VideosPath

const QString FMStatic::VideosPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)).toString()
inlinestatic

Definition at line 435 of file fmstatic.h.


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 Dec 20 2024 11:50:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.