mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 10:33:54 -07:00
minor cleanups and optimizations
This commit is contained in:
parent
b2f83541e7
commit
2c9a8c2b57
15 changed files with 391 additions and 248 deletions
44
cockatrice/src/settingscache.h
Normal file
44
cockatrice/src/settingscache.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef SETTINGSCACHE_H
|
||||
#define SETTINGSCACHE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QSettings;
|
||||
|
||||
class SettingsCache : public QObject {
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void langChanged();
|
||||
void picsPathChanged();
|
||||
void cardDatabasePathChanged();
|
||||
void picDownloadChanged();
|
||||
private:
|
||||
QSettings *settings;
|
||||
|
||||
QString lang;
|
||||
QString deckPath, picsPath, cardDatabasePath;
|
||||
bool picDownload;
|
||||
bool doubleClickToPlay;
|
||||
bool economicGrid;
|
||||
public:
|
||||
SettingsCache();
|
||||
QString getLang() const { return lang; }
|
||||
QString getDeckPath() const { return deckPath; }
|
||||
QString getPicsPath() const { return picsPath; }
|
||||
QString getCardDatabasePath() const { return cardDatabasePath; }
|
||||
bool getPicDownload() const { return picDownload; }
|
||||
bool getDoubleClickToPlay() const { return doubleClickToPlay; }
|
||||
bool getEconomicGrid() const { return economicGrid; }
|
||||
public slots:
|
||||
void setLang(const QString &_lang);
|
||||
void setDeckPath(const QString &_deckPath);
|
||||
void setPicsPath(const QString &_picsPath);
|
||||
void setCardDatabasePath(const QString &_cardDatabasePath);
|
||||
void setPicDownload(int _picDownload);
|
||||
void setDoubleClickToPlay(int _doubleClickToPlay);
|
||||
void setEconomicGrid(int _economicGrid);
|
||||
};
|
||||
|
||||
extern SettingsCache *settingsCache;
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue