mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 17:32:15 -07:00
move default urls to static const
This commit is contained in:
parent
54bcab4f0a
commit
1036aa21fc
2 changed files with 9 additions and 6 deletions
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
#include "settings_manager.h"
|
||||
|
||||
const QStringList DownloadSettings::DEFAULT_DOWNLOAD_URLS = {
|
||||
"https://api.scryfall.com/cards/!set:uuid!?format=image&face=!prop:side!",
|
||||
"https://api.scryfall.com/cards/multiverse/!set:muid!?format=image",
|
||||
"https://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=!set:muid!&type=card",
|
||||
"https://gatherer.wizards.com/Handlers/Image.ashx?name=!name!&type=card"};
|
||||
|
||||
DownloadSettings::DownloadSettings(const QString &settingPath, QObject *parent = nullptr)
|
||||
: SettingsManager(settingPath + "downloads.ini", parent)
|
||||
{
|
||||
|
|
@ -19,10 +25,5 @@ QStringList DownloadSettings::getAllURLs()
|
|||
|
||||
void DownloadSettings::resetToDefaultURLs()
|
||||
{
|
||||
auto downloadURLs = QStringList();
|
||||
downloadURLs.append("https://api.scryfall.com/cards/!set:uuid!?format=image&face=!prop:side!");
|
||||
downloadURLs.append("https://api.scryfall.com/cards/multiverse/!set:muid!?format=image");
|
||||
downloadURLs.append("https://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=!set:muid!&type=card");
|
||||
downloadURLs.append("https://gatherer.wizards.com/Handlers/Image.ashx?name=!name!&type=card");
|
||||
setValue(QVariant::fromValue(downloadURLs), "urls", "downloads");
|
||||
setValue(QVariant::fromValue(DEFAULT_DOWNLOAD_URLS), "urls", "downloads");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ class DownloadSettings : public SettingsManager
|
|||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
static const QStringList DEFAULT_DOWNLOAD_URLS;
|
||||
|
||||
public:
|
||||
explicit DownloadSettings(const QString &, QObject *);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue