From d02d3ed521daa6bbdb030dfff889dde695af7135 Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Sat, 17 Jan 2015 17:55:13 +0100 Subject: [PATCH] Refactored Deck Editor tab - removed heap allocation --- cockatrice/src/dlg_settings.cpp | 9 ++++----- cockatrice/src/dlg_settings.h | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index 5fd809ed..2dae4baa 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -537,14 +537,13 @@ void UserInterfaceSettingsPage::soundPathButtonClicked() DeckEditorSettingsPage::DeckEditorSettingsPage() { - priceTagsCheckBox = new QCheckBox; - priceTagsCheckBox->setChecked(settingsCache->getPriceTagFeature()); - connect(priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int))); + priceTagsCheckBox.setChecked(settingsCache->getPriceTagFeature()); + connect(&priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int))); connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int))); QGridLayout *generalGrid = new QGridLayout; - generalGrid->addWidget(priceTagsCheckBox, 0, 0); + generalGrid->addWidget(&priceTagsCheckBox, 0, 0); generalGroupBox = new QGroupBox; generalGroupBox->setLayout(generalGrid); @@ -557,7 +556,7 @@ DeckEditorSettingsPage::DeckEditorSettingsPage() void DeckEditorSettingsPage::retranslateUi() { - priceTagsCheckBox->setText(tr("Enable &price tag feature from deckbrew.com")); + priceTagsCheckBox.setText(tr("Enable &price tag feature from deckbrew.com")); generalGroupBox->setTitle(tr("General")); } diff --git a/cockatrice/src/dlg_settings.h b/cockatrice/src/dlg_settings.h index f366c4be..2939911e 100644 --- a/cockatrice/src/dlg_settings.h +++ b/cockatrice/src/dlg_settings.h @@ -144,8 +144,7 @@ private slots: signals: void priceTagSourceChanged(int _priceTagSource); private: - QCheckBox *priceTagsCheckBox; - QRadioButton *priceTagSource0, *priceTagSource1; + QCheckBox priceTagsCheckBox; QGroupBox *generalGroupBox; };