DolphinQt: properly remove slot connection for ConfigChange when object is destructed

This commit is contained in:
iwubcode 2020-09-12 17:06:17 -05:00
parent b1fecbb71c
commit a83bf8bc59
5 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ GraphicsBool::GraphicsBool(const QString& label, const Config::Info<bool>& setti
connect(this, &QCheckBox::toggled, this, &GraphicsBool::Update);
setChecked(Config::Get(m_setting) ^ reverse);
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);

View File

@ -17,7 +17,7 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::Info<in
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &GraphicsChoice::Update);
setCurrentIndex(Config::Get(m_setting));
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);

View File

@ -21,7 +21,7 @@ GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<in
setValue(Config::Get(setting));
connect(this, qOverload<int>(&GraphicsInteger::valueChanged), this, &GraphicsInteger::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);

View File

@ -17,7 +17,7 @@ GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::Info<int>
setChecked(Config::Get(m_setting) == m_value);
connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);

View File

@ -21,7 +21,7 @@ GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>
connect(this, &GraphicsSlider::valueChanged, this, &GraphicsSlider::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);