mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Set DeckList parent when ownership changes (#6317)
* Initialize all deck list member variables in constructor.
Took 10 minutes
* Revert "Initialize all deck list member variables in constructor."
This reverts commit fba2455808.
* setParent
Took 1 hour 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
84e0732fb1
commit
0f60824749
2 changed files with 3 additions and 0 deletions
|
|
@ -33,6 +33,7 @@ DeckLoader::DeckLoader(QObject *parent)
|
|||
DeckLoader::DeckLoader(QObject *parent, DeckList *_deckList)
|
||||
: QObject(parent), deckList(_deckList), lastFileFormat(CockatriceFormat), lastRemoteDeckId(-1)
|
||||
{
|
||||
deckList->setParent(this);
|
||||
}
|
||||
|
||||
DeckLoader::DeckLoader(const DeckLoader &other)
|
||||
|
|
@ -44,6 +45,7 @@ DeckLoader::DeckLoader(const DeckLoader &other)
|
|||
void DeckLoader::setDeckList(DeckList *_deckList)
|
||||
{
|
||||
deckList = _deckList;
|
||||
deckList->setParent(this);
|
||||
}
|
||||
|
||||
bool DeckLoader::loadFromFile(const QString &fileName, FileFormat fmt, bool userRequest)
|
||||
|
|
|
|||
|
|
@ -375,6 +375,7 @@ void DeckEditorDeckDockWidget::syncBannerCardComboBoxSelectionWithDeck()
|
|||
void DeckEditorDeckDockWidget::setDeck(DeckLoader *_deck)
|
||||
{
|
||||
deckLoader = _deck;
|
||||
deckLoader->setParent(this);
|
||||
deckModel->setDeckList(deckLoader->getDeckList());
|
||||
connect(deckLoader, &DeckLoader::deckLoaded, deckModel, &DeckListModel::rebuildTree);
|
||||
connect(deckLoader->getDeckList(), &DeckList::deckHashChanged, deckModel, &DeckListModel::deckHashChanged);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue