Remove redundant prefix from libcockatrice_card folders (#6237)

Took 28 minutes
This commit is contained in:
RickyRister 2025-10-09 14:09:20 -07:00 committed by GitHub
parent 14e6e6eff4
commit 636aa72141
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
120 changed files with 168 additions and 168 deletions

View file

@ -0,0 +1,19 @@
#include "token_display_model.h"
#include "../card_database_model.h"
TokenDisplayModel::TokenDisplayModel(QObject *parent) : CardDatabaseDisplayModel(parent)
{
}
bool TokenDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*sourceParent*/) const
{
CardInfoPtr info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
return info->getIsToken() && rowMatchesCardName(info);
}
int TokenDisplayModel::rowCount(const QModelIndex &parent) const
{
// always load all tokens at start
return QSortFilterProxyModel::rowCount(parent);
}

View file

@ -0,0 +1,23 @@
/**
* @file token_display_model.h
* @ingroup CardDatabaseModels
* @brief TODO: Document this.
*/
#ifndef COCKATRICE_TOKEN_DISPLAY_MODEL_H
#define COCKATRICE_TOKEN_DISPLAY_MODEL_H
#include "../card_database_display_model.h"
class TokenDisplayModel : public CardDatabaseDisplayModel
{
Q_OBJECT
public:
explicit TokenDisplayModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
};
#endif // COCKATRICE_TOKEN_DISPLAY_MODEL_H

View file

@ -0,0 +1,21 @@
#include "../token/token_edit_model.h"
#include "../../../card_info.h"
#include "../card_database_display_model.h"
#include "../card_database_model.h"
TokenEditModel::TokenEditModel(QObject *parent) : CardDatabaseDisplayModel(parent)
{
}
bool TokenEditModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*sourceParent*/) const
{
CardInfoPtr info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
return info->getIsToken() && info->getSets().contains(CardSet::TOKENS_SETNAME) && rowMatchesCardName(info);
}
int TokenEditModel::rowCount(const QModelIndex &parent) const
{
// always load all tokens at start
return QSortFilterProxyModel::rowCount(parent);
}

View file

@ -0,0 +1,23 @@
/**
* @file token_edit_model.h
* @ingroup CardDatabaseModels
* @brief TODO: Document this.
*/
#ifndef COCKATRICE_TOKEN_EDIT_MODEL_H
#define COCKATRICE_TOKEN_EDIT_MODEL_H
#include "../card_database_display_model.h"
class TokenEditModel : public CardDatabaseDisplayModel
{
Q_OBJECT
public:
explicit TokenEditModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
};
#endif // COCKATRICE_TOKEN_EDIT_MODEL_H