From a9ffbf5d2db104aabbc7ea7ec27cfe45813ccafb Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Wed, 2 Jul 2014 19:03:12 +0200 Subject: [PATCH] use a signal instead of calling QMetaObject::invokeMethod --- cockatrice/src/dlg_settings.cpp | 4 +++- cockatrice/src/dlg_settings.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index cf8fa846b..0d36dd185 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -549,6 +549,8 @@ DeckEditorSettingsPage::DeckEditorSettingsPage() connect(priceTagSource0, SIGNAL(toggled(bool)), this, SLOT(radioPriceTagSourceClicked(bool))); connect(priceTagSource1, SIGNAL(toggled(bool)), this, SLOT(radioPriceTagSourceClicked(bool))); + connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int))); + QGridLayout *generalGrid = new QGridLayout; generalGrid->addWidget(priceTagsCheckBox, 0, 0); generalGrid->addWidget(priceTagSource0, 1, 0); @@ -582,7 +584,7 @@ void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked) if(priceTagSource1->isChecked()) source=1; - QMetaObject::invokeMethod( settingsCache, "setPriceTagSource", Qt::QueuedConnection, Q_ARG(int, source)); + emit priceTagSourceChanged(source); } MessagesSettingsPage::MessagesSettingsPage() diff --git a/cockatrice/src/dlg_settings.h b/cockatrice/src/dlg_settings.h index 803e0dfc3..55685e1e9 100644 --- a/cockatrice/src/dlg_settings.h +++ b/cockatrice/src/dlg_settings.h @@ -103,6 +103,8 @@ public: void retranslateUi(); private slots: void radioPriceTagSourceClicked(bool checked); +signals: + void priceTagSourceChanged(int _priceTagSource); private: QCheckBox *priceTagsCheckBox; QRadioButton *priceTagSource0, *priceTagSource1;