[DeckList] refactor: pass DeckList by const ref (#6437)

* [DeckList] refactor: pass DeckList by const ref

* Change getDeckList to return a const ref
This commit is contained in:
RickyRister 2025-12-21 16:19:33 -08:00 committed by GitHub
parent 73a90bdf38
commit a0f977e80c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 70 additions and 75 deletions

View file

@ -59,11 +59,11 @@ public:
bool saveToFile(const QString &fileName, DeckFileFormat::Format fmt);
bool updateLastLoadedTimestamp(const QString &fileName, DeckFileFormat::Format fmt);
static QString exportDeckToDecklist(const DeckList *deckList, DecklistWebsite website);
static QString exportDeckToDecklist(const DeckList &deckList, DecklistWebsite website);
static void saveToClipboard(const DeckList *deckList, bool addComments = true, bool addSetNameAndNumber = true);
static void saveToClipboard(const DeckList &deckList, bool addComments = true, bool addSetNameAndNumber = true);
static bool saveToStream_Plain(QTextStream &out,
const DeckList *deckList,
const DeckList &deckList,
bool addComments = true,
bool addSetNameAndNumber = true);
@ -72,9 +72,9 @@ public:
* @param printer The printer to render the decklist to.
* @param deckList
*/
static void printDeckList(QPrinter *printer, const DeckList *deckList);
static void printDeckList(QPrinter *printer, const DeckList &deckList);
bool convertToCockatriceFormat(QString fileName);
bool convertToCockatriceFormat(const QString &fileName);
LoadedDeck &getDeck()
{
@ -91,7 +91,7 @@ public:
private:
static void printDeckListNode(QTextCursor *cursor, const InnerDecklistNode *node);
static void saveToStream_DeckHeader(QTextStream &out, const DeckList *deckList);
static void saveToStream_DeckHeader(QTextStream &out, const DeckList &deckList);
static void saveToStream_DeckZone(QTextStream &out,
const InnerDecklistNode *zoneNode,