From a0374d8fffa8649afc8d9c12ba11586daa35b332 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 6 Feb 2017 16:59:48 +0100 Subject: [PATCH] react to config change Summary: applets that acces their config in C++ needs to implement configChanged() in order to still work correctly in the scripting console Test Plan: correct icon when created from scripting console and config written from there Reviewers: #plasma, broulik Reviewed By: #plasma, broulik Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4461 --- applets/icon/iconapplet.cpp | 5 +++++ applets/icon/iconapplet.h | 1 + 2 files changed, 6 insertions(+) diff --git a/applets/icon/iconapplet.cpp b/applets/icon/iconapplet.cpp index d730fc4a4..4afa76bba 100644 --- a/applets/icon/iconapplet.cpp +++ b/applets/icon/iconapplet.cpp @@ -66,6 +66,11 @@ void IconApplet::init() populate(); } +void IconApplet::configChanged() +{ + populate(); +} + void IconApplet::populate() { m_url = config().readEntry(QStringLiteral("url"), QUrl()); diff --git a/applets/icon/iconapplet.h b/applets/icon/iconapplet.h index 804cb4a7b..605ae02cb 100644 --- a/applets/icon/iconapplet.h +++ b/applets/icon/iconapplet.h @@ -45,6 +45,7 @@ public: ~IconApplet() override; void init() override; + void configChanged() override; QUrl url() const; void setUrl(const QUrl &url);