mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Replace CardInfo* and Carset* with smart pointers (#3053)
* Replace CardInfo* and Carset* with smart pointers * fixes to help memory & c++11 stuff
This commit is contained in:
parent
3e418ba3c6
commit
517420cccb
37 changed files with 409 additions and 342 deletions
|
|
@ -144,9 +144,14 @@ void DlgCreateToken::closeEvent(QCloseEvent *event)
|
|||
void DlgCreateToken::tokenSelectionChanged(const QModelIndex ¤t, const QModelIndex & /*previous*/)
|
||||
{
|
||||
const QModelIndex realIndex = cardDatabaseDisplayModel->mapToSource(current);
|
||||
CardInfo *cardInfo = current.row() >= 0 ? cardDatabaseModel->getCard(realIndex.row()) : 0;
|
||||
|
||||
if (cardInfo) {
|
||||
CardInfoPtr cardInfo;
|
||||
|
||||
if (current.row() >= 0) {
|
||||
cardInfo = cardDatabaseModel->getCard(realIndex.row());
|
||||
}
|
||||
|
||||
if (!cardInfo) {
|
||||
updateSearchFieldWithoutUpdatingFilter(cardInfo->getName());
|
||||
const QChar cardColor = cardInfo->getColorChar();
|
||||
colorEdit->setCurrentIndex(colorEdit->findData(cardColor, Qt::UserRole, Qt::MatchFixedString));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue