clean up DownloadSettings (#5194)

* refactor DownloadSettings

* only reset to default on first run

* use c++ foreach

* use addItems

* move default urls to static const
This commit is contained in:
RickyRister 2024-11-25 18:12:56 -08:00 committed by GitHub
parent 5f1c03682f
commit a8471f62bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 53 deletions

View file

@ -10,20 +10,14 @@ class DownloadSettings : public SettingsManager
Q_OBJECT
friend class SettingsCache;
static const QStringList DEFAULT_DOWNLOAD_URLS;
public:
explicit DownloadSettings(const QString &, QObject *);
QStringList getAllURLs();
QString getDownloadUrlAt(int);
void setDownloadUrlAt(int, const QString &);
int getCount();
void clear();
private:
QStringList downloadURLs;
private:
void populateDefaultURLs();
void setDownloadUrls(const QStringList &downloadURLs);
void resetToDefaultURLs();
};
#endif // COCKATRICE_DOWNLOADSETTINGS_H