mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 08:03:54 -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
|
|
@ -4,7 +4,6 @@
|
|||
#include <QStyle>
|
||||
#include <QWidget>
|
||||
|
||||
#include "carddatabase.h"
|
||||
#include "carditem.h"
|
||||
#include "main.h"
|
||||
#include "pictureloader.h"
|
||||
|
|
@ -14,16 +13,16 @@ CardInfoPicture::CardInfoPicture(QWidget *parent) : QWidget(parent), info(nullpt
|
|||
setMinimumHeight(100);
|
||||
}
|
||||
|
||||
void CardInfoPicture::setCard(CardInfo *card)
|
||||
void CardInfoPicture::setCard(CardInfoPtr card)
|
||||
{
|
||||
if (info) {
|
||||
disconnect(info, nullptr, this, nullptr);
|
||||
disconnect(info.data(), nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
info = card;
|
||||
|
||||
if (info) {
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
connect(info.data(), SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
}
|
||||
|
||||
updatePixmap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue