From ea6fbd09f4af5a126ede47fde0841e924103ea85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Br=C3=BCbach=2C=20Lukas?= Date: Thu, 27 Nov 2025 12:26:52 +0100 Subject: [PATCH] Let's not lambda it and slot it instead. --- .../tabs/api/archidekt/tab_archidekt.cpp | 16 ++++++++-------- .../widgets/tabs/api/archidekt/tab_archidekt.h | 17 ++++++++--------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.cpp b/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.cpp index 9a7001e6f..b5f686413 100644 --- a/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.cpp +++ b/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.cpp @@ -67,7 +67,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor) orderDirButton->setCheckable(true); // checked = DESC, unchecked = ASC orderDirButton->setChecked(true); - connect(orderByCombo, &QComboBox::currentTextChanged, this, [this]() { doSearch(); }); + connect(orderByCombo, &QComboBox::currentTextChanged, this, &TabArchidekt::doSearch); connect(orderDirButton, &QPushButton::clicked, this, [this](bool checked) { orderDirButton->setText(checked ? tr("Desc.") : tr("Asc.")); doSearch(); @@ -106,7 +106,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor) for (int i = 0; i < formatNames.size(); ++i) { QCheckBox *formatCheckBox = new QCheckBox(formatNames[i], navigationContainer); - connect(formatCheckBox, &QCheckBox::clicked, this, [this]() { doSearch(); }); + connect(formatCheckBox, &QCheckBox::clicked, this, &TabArchidekt::doSearch); formatChecks << formatCheckBox; formatSettingsWidget->addSettingsWidget(formatCheckBox); } @@ -116,7 +116,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor) edhBracketCombo->addItem(tr("Any Bracket")); edhBracketCombo->addItems({"1", "2", "3", "4", "5"}); - connect(edhBracketCombo, &QComboBox::currentTextChanged, this, [this]() { doSearch(); }); + connect(edhBracketCombo, &QComboBox::currentTextChanged, this, &TabArchidekt::doSearch); // Search for Card Packages instead of Decks packagesCheck = new QCheckBox("Packages", navigationContainer); @@ -191,13 +191,13 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor) deckTagNameField = new QLineEdit(navigationContainer); deckTagNameField->setPlaceholderText("Deck tag"); - connect(deckTagNameField, &QLineEdit::textChanged, this, [this]() { doSearch(); }); + connect(deckTagNameField, &QLineEdit::textChanged, this, &TabArchidekt::doSearch); // Search button searchPushButton = new QPushButton(navigationContainer); searchPushButton->setText("Search"); - connect(searchPushButton, &QPushButton::clicked, this, [this]() { doSearch(); }); + connect(searchPushButton, &QPushButton::clicked, this, &TabArchidekt::doSearch); // Card Size settings settingsButton = new SettingsButtonWidget(this); @@ -217,8 +217,8 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor) minDeckSizeLogicCombo->addItems({"Exact", "≥", "≤"}); // Exact = unset, ≥ = GTE, ≤ = LTE minDeckSizeLogicCombo->setCurrentIndex(1); // default GTE - connect(minDeckSizeSpin, QOverload::of(&QSpinBox::valueChanged), this, [this]() { doSearch(); }); - connect(minDeckSizeLogicCombo, &QComboBox::currentTextChanged, this, [this]() { doSearch(); }); + connect(minDeckSizeSpin, QOverload::of(&QSpinBox::valueChanged), this, &TabArchidekt::doSearch); + connect(minDeckSizeLogicCombo, &QComboBox::currentTextChanged, this, &TabArchidekt::doSearch); // Page number pageLabel = new QLabel(navigationContainer); @@ -227,7 +227,7 @@ TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor) pageSpin->setRange(1, 9999); pageSpin->setValue(1); - connect(pageSpin, &QSpinBox::valueChanged, this, [this]() { doSearch(); }); + connect(pageSpin, &QSpinBox::valueChanged, this, &TabArchidekt::doSearch); // Page display currentPageDisplay = new QWidget(container); diff --git a/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.h b/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.h index e3df6e135..68a5b78c9 100644 --- a/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.h +++ b/cockatrice/src/interface/widgets/tabs/api/archidekt/tab_archidekt.h @@ -67,15 +67,6 @@ public: */ QString buildSearchUrl(); - /** - * @brief Trigger a search using the current filters - * - * Sends a network request to the Archidekt API using the URL generated by buildSearchUrl(). - * Updates the current page display with results asynchronously. - */ - void doSearch(); - void doSearchImmediate(); - /** * @brief Retrieve the tab display text * @return QString Human-readable title for the tab @@ -103,6 +94,14 @@ public: QNetworkAccessManager *networkManager; public slots: + /** + * @brief Trigger a search using the current filters + * + * Sends a network request to the Archidekt API using the URL generated by buildSearchUrl(). + * Updates the current page display with results asynchronously. + */ + void doSearch(); + void doSearchImmediate(); /** * @brief Process a network reply containing JSON data * @param reply QNetworkReply object with the API response