mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
A DeckLoader is not a DeckList. (#6306)
* A DeckLoader is not a DeckList. Took 2 hours 39 minutes * Explicitly initialize base class in copy constructor? Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
4c431e98a6
commit
8e88749078
32 changed files with 163 additions and 139 deletions
|
|
@ -32,6 +32,8 @@ void DeckEditorDeckDockWidget::createDeckDock()
|
|||
deckModel->setObjectName("deckModel");
|
||||
connect(deckModel, &DeckListModel::deckHashChanged, this, &DeckEditorDeckDockWidget::updateHash);
|
||||
|
||||
deckLoader = new DeckLoader(this, deckModel->getDeckList());
|
||||
|
||||
DeckListStyleProxy *proxy = new DeckListStyleProxy(this);
|
||||
proxy->setSourceModel(deckModel);
|
||||
|
||||
|
|
@ -373,10 +375,9 @@ void DeckEditorDeckDockWidget::syncBannerCardComboBoxSelectionWithDeck()
|
|||
void DeckEditorDeckDockWidget::setDeck(DeckLoader *_deck)
|
||||
{
|
||||
deckLoader = _deck;
|
||||
|
||||
deckModel->setDeckList(_deck);
|
||||
connect(_deck, &DeckLoader::deckLoaded, deckModel, &DeckListModel::rebuildTree);
|
||||
connect(_deck, &DeckLoader::deckHashChanged, deckModel, &DeckListModel::deckHashChanged);
|
||||
deckModel->setDeckList(deckLoader->getDeckList());
|
||||
connect(deckLoader, &DeckLoader::deckLoaded, deckModel, &DeckListModel::rebuildTree);
|
||||
connect(deckLoader->getDeckList(), &DeckList::deckHashChanged, deckModel, &DeckListModel::deckHashChanged);
|
||||
|
||||
nameEdit->setText(deckModel->getDeckList()->getName());
|
||||
commentsEdit->setText(deckModel->getDeckList()->getComments());
|
||||
|
|
@ -398,6 +399,11 @@ DeckLoader *DeckEditorDeckDockWidget::getDeckLoader()
|
|||
return deckLoader;
|
||||
}
|
||||
|
||||
DeckList *DeckEditorDeckDockWidget::getDeckList()
|
||||
{
|
||||
return deckModel->getDeckList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the tab to the state for a blank new tab.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public slots:
|
|||
void updateBannerCardComboBox();
|
||||
void setDeck(DeckLoader *_deck);
|
||||
DeckLoader *getDeckLoader();
|
||||
DeckList *getDeckList();
|
||||
void actIncrement();
|
||||
bool swapCard(const QModelIndex &idx);
|
||||
void actDecrementCard(const ExactCard &card, QString zoneName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue