|
RhythmGame 1.4.3
|
Manages the download and storage of tables from given URLs. More...
#include <Tables.h>


Signals | |
| void | contentsChanged () |
| void | externalReloadRequested () |
Public Member Functions | |
| Tables (QNetworkAccessManager *networkManager, const QDir &tableLocation, db::SqliteCppDb *db, QObject *parent=nullptr) | |
| ~Tables () override | |
| auto | rowCount (const QModelIndex &parent) const -> int override |
| auto | data (const QModelIndex &index, int role) const -> QVariant override |
| Q_INVOKABLE void | removeAt (int index) |
| Removes the table at the specified index. | |
| Q_INVOKABLE void | add (const QUrl &url) |
| Adds a new table from the specified URL. | |
| Q_INVOKABLE void | reload (int index) |
| Reloads the table at the specified index. | |
| Q_INVOKABLE bool | reloadTable (const Table &table) |
| Q_INVOKABLE QVariant | resolveTable (const Table &table) const |
| Q_INVOKABLE QVariant | resolveLevel (const Table &table, const Level &level) const |
| Q_INVOKABLE void | reorder (int from, int to) |
| Reorders a table from one index to another. | |
| Q_INVOKABLE QVariantList | getList () |
| Retrieves a list of all tables as QVariantList. | |
| void | setExternalTables (QList< Table > tables) |
| Q_INVOKABLE QList< TableInfo > | search (const QString &identifier) |
| Searches for a chart across downloaded and externally managed tables. | |
Manages the download and storage of tables from given URLs.
The Tables class handles downloading table data from specified URLs, storing it in a local cache file, and parsing the data for use in QML. It provides methods to add, remove, reload, and reorder tables, as well as search for entries by MD5 or sha256/<hash> identifier.
|
explicit |
|
override |
| void resource_managers::Tables::add | ( | const QUrl & | url | ) |
Adds a new table from the specified URL.
| url | The URL of the table to add. |
|
signal |
|
override |
|
signal |
| auto resource_managers::Tables::getList | ( | ) |
Retrieves a list of all tables as QVariantList.
| void resource_managers::Tables::reload | ( | int | index | ) |
Reloads the table at the specified index.
This will re-download and parse the table data from its URL.
| index | The index of the table to reload. |
| auto resource_managers::Tables::reloadTable | ( | const Table & | table | ) |
Reloads a collection through the provider that owns it.
| void resource_managers::Tables::removeAt | ( | int | index | ) |
Removes the table at the specified index.
| index | The index of the table to remove. |
| void resource_managers::Tables::reorder | ( | int | from, |
| int | to | ||
| ) |
Reorders a table from one index to another.
| from | The current index of the table. |
| to | The new index to move the table to. |
| auto resource_managers::Tables::resolveTable | ( | const Table & | table | ) | const |
Resolves a retained table or level against the current catalog.
|
override |
| auto resource_managers::Tables::search | ( | const QString & | identifier | ) |
Searches for a chart across downloaded and externally managed tables.
| identifier | A plain MD5 hash or a sha256/<hash> identifier, as returned for missing stages by Course::loadCharts(). Matching is case-insensitive. |
| void resource_managers::Tables::setExternalTables | ( | QList< Table > | tables | ) |