mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 12:33:55 -07:00
WIP: Refactor gamesproxymodel to own the persistence layer.
This commit is contained in:
parent
16bbc5e8c0
commit
6a4384f903
5 changed files with 98 additions and 60 deletions
|
|
@ -49,6 +49,12 @@ private:
|
|||
QString gameNameFilter, creatorNameFilter;
|
||||
QSet<int> gameTypeFilter;
|
||||
int maxPlayersFilterMin, maxPlayersFilterMax;
|
||||
|
||||
/*
|
||||
* The game type might contain special characters, so to use it in
|
||||
* QSettings we just hash it.
|
||||
*/
|
||||
QString hashGameType(const QString &gameType) const;
|
||||
public:
|
||||
GamesProxyModel(QObject *parent = 0, ServerInfo_User *_ownUser = 0);
|
||||
|
||||
|
|
@ -66,6 +72,8 @@ public:
|
|||
int getMaxPlayersFilterMax() const { return maxPlayersFilterMax; }
|
||||
void setMaxPlayersFilter(int _maxPlayersFilterMin, int _maxPlayersFilterMax);
|
||||
void resetFilterParameters();
|
||||
void loadFilterParameters(const QMap<int, QString> &allGameTypes);
|
||||
void saveFilterParameters();
|
||||
protected:
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue