![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <download_settings.h>
Signals | |
| void | picDownloadChanged () |
| void | downloadSpoilerStatusChanged () |
| void | hostRequestLimitsChanged () |
Public Member Functions | |
| DownloadSettings (const QString &, QObject *) | |
| QStringList | getAllURLs () const |
| void | setDownloadUrls (const QStringList &downloadURLs) |
| void | resetToDefaultURLs () |
| bool | addLocalizedScryfallUrl () |
| bool | getPicDownload () const |
| void | setPicDownload (bool _picDownload) |
| bool | getDownloadSpoilersStatus () const |
| void | setDownloadSpoilerStatus (bool _spoilerStatus) |
| QHash< QString, int > | getHostRequestLimits () const |
| User-set per-host request allowances (requests/second). Missing hosts use the developer default. | |
| void | setHostRequestLimits (const QHash< QString, int > &hostRequestLimits) |
| int | clampHostRequestLimit (const QString &host, int requested) const |
| Clamps the user's requested allowance for a host against its developer cap. | |
| Public Member Functions inherited from SettingsManager | |
| SettingsManager (const QString &settingPath, const QString &defaultGroup=QString(), const QString &defaultSubGroup=QString(), QObject *parent=nullptr) | |
| QVariant | getValue (const QString &name) const |
| QVariant | getValue (const QString &name, const QString &group, const QString &subGroup=QString()) const |
| QVariant | getValue (const QString &name, const QString &group, const QString &subGroup, const QVariant &defaultValue) const |
| void | batchWrite (std::function< void(QSettings &)> batchWriteFunction) |
| void | sync () |
Static Public Member Functions | |
| static const QHash< QString, int > & | getDeveloperHostCaps () |
| Developer-set per-host allowance ceilings (requests/second), keyed by host. | |
Static Public Attributes | |
| static constexpr int | DEFAULT_HOST_REQUEST_LIMIT = 10 |
| Per-host request allowance (requests/second) when no developer cap applies. | |
| static constexpr int | MIN_HOST_REQUEST_LIMIT = 1 |
| Floor for any per-host request allowance. | |
| static constexpr int | UNLOCKED_HOST_LIMIT_MAX = 50 |
| Upper bound offered to the user when lowering an unlocked host's allowance. | |
| static constexpr int | UNLIMITED_HOST_QUOTA = -1 |
| Developer cap marking a host as never throttled per host or by the dispatch pacing. | |
Static Private Attributes | |
| static const QStringList | DEFAULT_DOWNLOAD_URLS |
| static const QString | SCRYFALL_NAMED_LOCALIZED_URL |
| static const QHash< QString, int > | DEVELOPER_HOST_CAPS |
Friends | |
| class | SettingsCache |
Additional Inherited Members | |
| Protected Member Functions inherited from SettingsManager | |
| QSettings | getSettings () const |
| void | setValue (const QVariant &value, const QString &name) |
| void | setValue (const QVariant &value, const QString &name, const QString &group, const QString &subGroup=QString()) |
| void | deleteValue (const QString &name) |
| void | deleteValue (const QString &name, const QString &group, const QString &subGroup=QString()) |
| Protected Attributes inherited from SettingsManager | |
| QString | settingPath |
| QString | defaultGroup |
| QString | defaultSubGroup |
|
explicit |
|
nodiscard |
|
nodiscard |
Clamps the user's requested allowance for a host against its developer cap.
| host | The host to clamp for |
| requested | The user-requested allowance in requests/second |
|
signal |
| QStringList DownloadSettings::getAllURLs | ( | ) | const |
|
static |
Developer-set per-host allowance ceilings (requests/second), keyed by host.
Hosts not present default to DEFAULT_HOST_REQUEST_LIMIT. An entry of UNLIMITED_HOST_QUOTA marks a host that users may still lower, but that is never throttled per host by default. Users can never raise a host's allowance above its developer cap.
|
nodiscard |
| QHash< QString, int > DownloadSettings::getHostRequestLimits | ( | ) | const |
User-set per-host request allowances (requests/second). Missing hosts use the developer default.
|
nodiscard |
|
signal |
|
signal |
| void DownloadSettings::resetToDefaultURLs | ( | ) |
| void DownloadSettings::setDownloadSpoilerStatus | ( | bool | _spoilerStatus | ) |
| void DownloadSettings::setDownloadUrls | ( | const QStringList & | downloadURLs | ) |
| void DownloadSettings::setHostRequestLimits | ( | const QHash< QString, int > & | hostRequestLimits | ) |
| void DownloadSettings::setPicDownload | ( | bool | _picDownload | ) |
|
friend |
|
staticprivate |
|
staticconstexpr |
Per-host request allowance (requests/second) when no developer cap applies.
|
staticprivate |
|
staticconstexpr |
Floor for any per-host request allowance.
|
staticprivate |
|
staticconstexpr |
Developer cap marking a host as never throttled per host or by the dispatch pacing.
|
staticconstexpr |
Upper bound offered to the user when lowering an unlocked host's allowance.
Unlocked hosts have no developer cap, so clampHostRequestLimit puts no upper bound on them; this only bounds what the settings dialog offers, and matches the widest paced allowance a user is documented to be able to hand-edit in downloads.ini. Choosing 0 below this restores the "unlimited" fast path.