mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Dependency Injection for SettingsCache
* Turn SettingsCache into a QSharedPointer. * Implement interfaces for settings that need it Took 2 hours 38 minutes
This commit is contained in:
parent
b773909dfd
commit
35d18b5fa9
127 changed files with 1012 additions and 803 deletions
|
|
@ -13,27 +13,24 @@
|
|||
#include <QObject>
|
||||
#include <QSettings>
|
||||
#include <QVariant>
|
||||
#include <libcockatrice/card/database/interface/interface_card_set_priority_controller.h>
|
||||
|
||||
class CardDatabaseSettings : public SettingsManager
|
||||
class CardDatabaseSettings : public SettingsManager, public ICardSetPriorityController
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
void setSortKey(QString shortName, unsigned int sortKey);
|
||||
void setEnabled(QString shortName, bool enabled);
|
||||
void setIsKnown(QString shortName, bool isknown);
|
||||
void setSortKey(QString shortName, unsigned int sortKey) override;
|
||||
void setEnabled(QString shortName, bool enabled) override;
|
||||
void setIsKnown(QString shortName, bool isknown) override;
|
||||
|
||||
unsigned int getSortKey(QString shortName);
|
||||
bool isEnabled(QString shortName);
|
||||
bool isKnown(QString shortName);
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
unsigned int getSortKey(QString shortName) override;
|
||||
bool isEnabled(QString shortName) override;
|
||||
bool isKnown(QString shortName) override;
|
||||
|
||||
private:
|
||||
explicit CardDatabaseSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
CardDatabaseSettings(const CardDatabaseSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // CARDDATABASESETTINGS_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue