Use separate face controller for appearance config

This is a workaround for the page being totally broken on when opened
again after the dialog was closed for the first time. Using a new controller
works around that.
BUG:424458
wilder-5.22
David Redondo 5 years ago
parent 83982f8e5c
commit cfd0ba7806
  1. 8
      applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigAppearance.qml
  2. 7
      applets/systemmonitor/systemmonitor/systemmonitor.cpp
  3. 3
      applets/systemmonitor/systemmonitor/systemmonitor.h

@ -39,10 +39,12 @@ QQC2.Control {
function saveConfig() {
contentItem.saveConfig();
plasmoid.nativeInterface.faceController.reloadConfig()
}
contentItem: plasmoid.nativeInterface.faceController.appearanceConfigUi
// Workaround for Bug 424458, when reusing the controller/item things break
contentItem: plasmoid.nativeInterface.workaroundController(root).appearanceConfigUi
Connections {
target: contentItem
function onConfigurationChanged() {

@ -77,6 +77,13 @@ KSysGuard::SensorFaceController *SystemMonitor::faceController() const
return m_sensorFaceController;
}
KSysGuard::SensorFaceController *SystemMonitor::workaroundController(QQuickItem *context) const
{
KConfigGroup cg = config();
return new KSysGuard::SensorFaceController(cg, qmlEngine(context));
}
void SystemMonitor::configChanged()
{
if (m_sensorFaceController) {

@ -52,6 +52,9 @@ public:
KSysGuard::SensorFaceController *faceController() const;
// Workaround for Bug 424458, when reusing the controller/item things break in ConfigAppearance
Q_INVOKABLE KSysGuard::SensorFaceController *workaroundController(QQuickItem *context) const;
public Q_SLOTS:
void configChanged() override;

Loading…
Cancel
Save