MauiKit File Browsing
fileloader.h
34 * @brief The FileLoader class asynchronously loads batches of files from a given list of local directories or tags, allowing to filter them by name, mime-types, and much more.
36 * The execution of the file listing will be moved into a different thread, - so to retrieve the information you will depend on the exposed signals and the `informer` callback function to give structure to the data.
39 * The following code snippet demonstrates the usage, by listing all the content in the downloads and pictures local directories.
58 * QObject::connect(&loader, &FMH::FileLoader::itemsReady, [=](FMH::MODEL_LIST items, QList<QUrl> urls) {
64 * QObject::connect(&loader, &FMH::FileLoader::finished, [=](FMH::MODEL_LIST items, QList<QUrl> urls) {
89 * This allows to dispatch item files which are ready and don't have to wait for the operation to finished completely, in case there are too many files to wait for.
96 * @brief The amount of items which will be dispatched while iterating throughout all the given directories.
101 * @brief Sends the request to start iterating throughout all the given location URLs, and with the given parameters.
102 * @param urls the list of directories or locations to iterate. This operation only supports local directories and tags.
103 * @param recursive Whether the iteration should be done recursively and navigate sub-folder structures
104 * @param nameFilters a list of filtering strings, this can be used with regular expressions, for example `*.jpg` to only list files ending with the given suffix. Dy default this is set to an empty array, so nothing will be filtered.
108 void requestPath(const QList<QUrl> &urls, const bool &recursive, const QStringList &nameFilters = {}, const QDir::Filters &filters = QDir::Files, const uint &limit = 99999);
111 * @brief A callback function which structures the retrieved file URLs, with the required information. This callback function will receive the file URL, and expects a FMH::MODEL to be formed and returned. By default this informer callback function is set to `FMStatic::getFileInfoModel`, which retrieves basic information about a file.
122 void getFiles(QList<QUrl> paths, bool recursive, const QStringList &nameFilters, const QDir::Filters &filters, uint limit);
126 * @brief Emitted once the operation has completely finished retrieving all the existing files or reached the limit number of requested files.
127 * @param items all of the retrieved items. The items data model is created using the `informer` callback function.
136 void start(QList<QUrl> urls, bool recursive, QStringList nameFilters, QDir::Filters filters, uint limit);
The FileLoader class asynchronously loads batches of files from a given list of local directories or ...
Definition fileloader.h:76
static std::function< FMH::MODEL(const QUrl &url)> informer
A callback function which structures the retrieved file URLs, with the required information.
Definition fileloader.h:116
void finished(FMH::MODEL_LIST items, QList< QUrl > urls)
Emitted once the operation has completely finished retrieving all the existing files or reached the l...
void itemReady(FMH::MODEL item, QList< QUrl > urls)
Emitted for every single item that becomes available.
void itemsReady(FMH::MODEL_LIST items, QList< QUrl > urls)
Emitted when the batch of file items is ready.
Q_SCRIPTABLE Q_NOREPLY void start()
QHash< MODEL_KEY, QString > MODEL
Filters
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.