don't emit signals in dtors

This commit is contained in:
RickyRister 2025-01-11 16:11:07 -08:00
parent 48414986f8
commit b4d7b2cd22
8 changed files with 34 additions and 45 deletions

View file

@ -358,7 +358,7 @@ void TabDeckEditor::createMenus()
analyzeDeckMenu->addAction(aAnalyzeDeckTappedout);
aClose = new QAction(QString(), this);
connect(aClose, SIGNAL(triggered()), this, SLOT(closeRequest()));
connect(aClose, &QAction::triggered, this, [this](bool) { closeRequest(); });
aClearFilterAll = new QAction(QString(), this);
aClearFilterAll->setIcon(QPixmap("theme:icons/clearsearch"));
@ -721,11 +721,6 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
loadLayout();
}
TabDeckEditor::~TabDeckEditor()
{
emit deckEditorClosing(this);
}
void TabDeckEditor::retranslateUi()
{
cardInfo->retranslateUi();
@ -982,8 +977,12 @@ bool TabDeckEditor::confirmClose()
void TabDeckEditor::closeRequest(bool forced)
{
if (confirmClose())
deleteLater();
if (!forced && !confirmClose()) {
return;
}
emit deckEditorClosing(this);
deleteLater();
}
void TabDeckEditor::actNewDeck()