mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
[DeckList] Disable copy constructor (#6339)
* [DeckList] Disable copy constructor Took 1 hour 44 minutes Took 1 minute # Commit time for manual adjustment: # Took 28 seconds Took 33 seconds * Revert member to pointer. Took 19 minutes * Revert pulling up setters/getters now that getDeckList is no longer const. Took 6 minutes * Revert more. Took 2 minutes * One more fix. Took 1 minute * Update cockatrice/src/interface/deck_loader/deck_loader.cpp Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com> --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
parent
9957cb20e2
commit
ab5d6db8a2
18 changed files with 49 additions and 69 deletions
|
|
@ -486,7 +486,7 @@ void AbstractTabDeckEditor::actLoadDeckFromClipboard()
|
|||
*/
|
||||
void AbstractTabDeckEditor::editDeckInClipboard(bool annotated)
|
||||
{
|
||||
DlgEditDeckInClipboard dlg(*getDeckLoader(), annotated, this);
|
||||
DlgEditDeckInClipboard dlg(getDeckLoader(), annotated, this);
|
||||
if (!dlg.exec())
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -242,11 +242,11 @@ void TabDeckStorage::actOpenLocalDeck()
|
|||
continue;
|
||||
QString filePath = localDirModel->filePath(curLeft);
|
||||
|
||||
DeckLoader deckLoader(this);
|
||||
if (!deckLoader.loadFromFile(filePath, DeckLoader::CockatriceFormat, true))
|
||||
auto deckLoader = new DeckLoader(this);
|
||||
if (!deckLoader->loadFromFile(filePath, DeckLoader::CockatriceFormat, true))
|
||||
continue;
|
||||
|
||||
emit openDeckEditor(&deckLoader);
|
||||
emit openDeckEditor(deckLoader);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -869,7 +869,7 @@ TabDeckEditor *TabSupervisor::addDeckEditorTab(DeckLoader *deckToOpen)
|
|||
{
|
||||
auto *tab = new TabDeckEditor(this);
|
||||
if (deckToOpen)
|
||||
tab->openDeck(new DeckLoader(this, deckToOpen->getDeckList()));
|
||||
tab->openDeck(deckToOpen);
|
||||
connect(tab, &AbstractTabDeckEditor::deckEditorClosing, this, &TabSupervisor::deckEditorClosed);
|
||||
connect(tab, &AbstractTabDeckEditor::openDeckEditor, this, &TabSupervisor::addDeckEditorTab);
|
||||
myAddTab(tab);
|
||||
|
|
@ -882,7 +882,7 @@ TabDeckEditorVisual *TabSupervisor::addVisualDeckEditorTab(DeckLoader *deckToOpe
|
|||
{
|
||||
auto *tab = new TabDeckEditorVisual(this);
|
||||
if (deckToOpen)
|
||||
tab->openDeck(new DeckLoader(this, deckToOpen->getDeckList()));
|
||||
tab->openDeck(deckToOpen);
|
||||
connect(tab, &AbstractTabDeckEditor::deckEditorClosing, this, &TabSupervisor::deckEditorClosed);
|
||||
connect(tab, &AbstractTabDeckEditor::openDeckEditor, this, &TabSupervisor::addVisualDeckEditorTab);
|
||||
myAddTab(tab);
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor)
|
|||
|
||||
void TabDeckStorageVisual::actOpenLocalDeck(const QString &filePath)
|
||||
{
|
||||
DeckLoader deckLoader(this);
|
||||
if (!deckLoader.loadFromFile(filePath, DeckLoader::getFormatFromName(filePath), true)) {
|
||||
auto deckLoader = new DeckLoader(this);
|
||||
if (!deckLoader->loadFromFile(filePath, DeckLoader::getFormatFromName(filePath), true)) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not open deck at %1").arg(filePath));
|
||||
return;
|
||||
}
|
||||
|
||||
emit openDeckEditor(&deckLoader);
|
||||
emit openDeckEditor(deckLoader);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue