mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 20:43:54 -07:00
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:
parent
5f1c03682f
commit
a8471f62bc
4 changed files with 21 additions and 53 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue