mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
Parent MoveMenu to CardMenu to fix memory leak on menu rebuild
This commit is contained in:
parent
919b9d92ac
commit
3e90748f73
3 changed files with 7 additions and 7 deletions
|
|
@ -203,7 +203,7 @@ void CardMenu::createTableMenu(bool canModifyCard)
|
|||
}
|
||||
addSeparator();
|
||||
addAction(aClone);
|
||||
addMenu(new MoveMenu(player));
|
||||
addMenu(new MoveMenu(player, this));
|
||||
addSeparator();
|
||||
addAction(aAttach);
|
||||
if (card->getAttachedTo()) {
|
||||
|
|
@ -253,7 +253,7 @@ void CardMenu::createStackMenu(bool canModifyCard)
|
|||
addAction(aPlayFacedown);
|
||||
addSeparator();
|
||||
addAction(aClone);
|
||||
addMenu(new MoveMenu(player));
|
||||
addMenu(new MoveMenu(player, this));
|
||||
addSeparator();
|
||||
addAction(aAttach);
|
||||
addAction(aDrawArrow);
|
||||
|
|
@ -282,7 +282,7 @@ void CardMenu::createGraveyardOrExileMenu(bool canModifyCard)
|
|||
addAction(aPlayFacedown);
|
||||
addSeparator();
|
||||
addAction(aClone);
|
||||
addMenu(new MoveMenu(player));
|
||||
addMenu(new MoveMenu(player, this));
|
||||
addSeparator();
|
||||
addAction(aAttach);
|
||||
addAction(aDrawArrow);
|
||||
|
|
@ -320,7 +320,7 @@ void CardMenu::createHandOrCustomZoneMenu(bool canModifyCard)
|
|||
|
||||
addSeparator();
|
||||
addAction(aClone);
|
||||
addMenu(new MoveMenu(player));
|
||||
addMenu(new MoveMenu(player, this));
|
||||
|
||||
// actions that are really wonky when done from deck or sideboard
|
||||
if (card->getZone()->getName() == ZoneNames::HAND) {
|
||||
|
|
@ -344,7 +344,7 @@ void CardMenu::createHandOrCustomZoneMenu(bool canModifyCard)
|
|||
void CardMenu::createZonelessMenu(bool canModifyCard)
|
||||
{
|
||||
if (canModifyCard) {
|
||||
addMenu(new MoveMenu(player));
|
||||
addMenu(new MoveMenu(player, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "../card_menu_action_type.h"
|
||||
#include "../player_graphics_item.h"
|
||||
|
||||
MoveMenu::MoveMenu(PlayerGraphicsItem *player) : QMenu(tr("Move to"))
|
||||
MoveMenu::MoveMenu(PlayerGraphicsItem *player, QWidget *parent) : QMenu(tr("Move to"), parent)
|
||||
{
|
||||
aMoveToTopLibrary = new QAction(this);
|
||||
aMoveToTopLibrary->setData(cmMoveToTopLibrary);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class MoveMenu : public QMenu
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MoveMenu(PlayerGraphicsItem *player);
|
||||
explicit MoveMenu(PlayerGraphicsItem *player, QWidget *parent);
|
||||
void setShortcutsActive();
|
||||
void retranslateUi();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue