[DeckList] Disable copy constructor

Took 1 hour 44 minutes

Took 1 minute

# Commit time for manual adjustment:
# Took 28 seconds


Took 33 seconds
This commit is contained in:
Lukas Brübach 2025-11-19 13:22:09 +01:00
parent 8788a7aada
commit 9260bebd1c
21 changed files with 162 additions and 105 deletions

View file

@ -80,20 +80,6 @@ DeckList::DeckList()
root = new InnerDecklistNode;
}
// TODO: https://qt-project.org/doc/qt-4.8/qobject.html#no-copy-constructor-or-assignment-operator
DeckList::DeckList(const DeckList &other)
: QObject(), name(other.name), comments(other.comments), bannerCard(other.bannerCard),
lastLoadedTimestamp(other.lastLoadedTimestamp), tags(other.tags), cachedDeckHash(other.cachedDeckHash)
{
root = new InnerDecklistNode(other.getRoot());
QMapIterator<QString, SideboardPlan *> spIterator(other.getSideboardPlans());
while (spIterator.hasNext()) {
spIterator.next();
sideboardPlans.insert(spIterator.key(), new SideboardPlan(spIterator.key(), spIterator.value()->getMoveList()));
}
}
DeckList::DeckList(const QString &nativeString)
{
root = new InnerDecklistNode;

View file

@ -215,8 +215,9 @@ public slots:
public:
/// @brief Construct an empty deck.
explicit DeckList();
/// @brief Deep-copy constructor.
DeckList(const DeckList &other);
/// @brief Delete copy constructor.
DeckList(const DeckList &) = delete;
DeckList &operator=(const DeckList &) = delete;
/// @brief Construct from a serialized native-format string.
explicit DeckList(const QString &nativeString);
~DeckList() override;