From 3380ee541f309c60f1df1e38323f09d3abc03b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Fri, 9 May 2025 04:06:35 +0200 Subject: [PATCH] Lint. --- .../src/dialogs/dlg_get_card_prices.cpp | 2 +- cockatrice/src/dialogs/dlg_get_card_prices.h | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cockatrice/src/dialogs/dlg_get_card_prices.cpp b/cockatrice/src/dialogs/dlg_get_card_prices.cpp index aeb39998f..0fbc0a41f 100644 --- a/cockatrice/src/dialogs/dlg_get_card_prices.cpp +++ b/cockatrice/src/dialogs/dlg_get_card_prices.cpp @@ -162,7 +162,7 @@ void DlgGetCardPrices::startCardPriceRequests() if (excludeLandsCheckBox->isChecked()) { CardInfoPtr card = CardDatabaseManager::getInstance()->getCard(cardName); - if (!card || card->getMainCardType() == "Land") + if (!card || card->getMainCardType() == "Land") continue; } diff --git a/cockatrice/src/dialogs/dlg_get_card_prices.h b/cockatrice/src/dialogs/dlg_get_card_prices.h index 2f77a903f..34eaa6692 100644 --- a/cockatrice/src/dialogs/dlg_get_card_prices.h +++ b/cockatrice/src/dialogs/dlg_get_card_prices.h @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include #include #include @@ -19,20 +19,23 @@ class DeckListModel; class QLabel; class QScrollArea; -class CardPriceTableWidgetItem : public QTableWidgetItem { +class CardPriceTableWidgetItem : public QTableWidgetItem +{ public: // Constructor - CardPriceTableWidgetItem(const QString &text) : QTableWidgetItem(text) {} + CardPriceTableWidgetItem(const QString &text) : QTableWidgetItem(text) + { + } bool operator<(const QTableWidgetItem &other) const override { bool ok1, ok2; - double val1 = text().remove('%').toDouble(&ok1); // Remove '%' and convert to double - double val2 = other.text().remove('%').toDouble(&ok2); // Remove '%' and convert to double + double val1 = text().remove('%').toDouble(&ok1); // Remove '%' and convert to double + double val2 = other.text().remove('%').toDouble(&ok2); // Remove '%' and convert to double // Handle non-numeric cases gracefully if (ok1 && ok2) { - return val1 < val2; // Compare as double values + return val1 < val2; // Compare as double values } // If conversion to double failed, fallback to string comparison @@ -40,7 +43,6 @@ public: } }; - class DlgGetCardPrices : public QDialog { Q_OBJECT @@ -48,11 +50,11 @@ class DlgGetCardPrices : public QDialog public: explicit DlgGetCardPrices(QWidget *parent, DeckListModel *_model); - signals: - void allRequestsFinished(); +signals: + void allRequestsFinished(); - private slots: - void onCardPriceReply(); +private slots: + void onCardPriceReply(); void onAllRequestsFinished(); void actOK(); void onSelectionChanged(); @@ -95,7 +97,6 @@ private: int totalCardsToProcess = 0; int finishedCardCount = 0; - }; #endif // DLG_GET_CARD_PRICES_H