From 89fb70b571155deaee5a20af97d86c01460f9dcd Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 10 Dec 2019 08:41:32 +0000 Subject: Fix writeFlags with KConfigCompilerSignallingItem Summary: KConfigCompilerSignallingItem both inherits KConfigSkeletonItem and internally is powered by a separate KConfigSkeletonItem The generated code calls setWriteFlags on the outer KConfigCompilerSignallingItem instance, but the real writing is performed by the internal version. We need to set the flags in the right place. Ideally we would do this in an overload of KConfigSkeletonItem, but given we can't, I've shadowed the method. This isn't pretty, but given the docs say it should generally only be used from auto generated code, should be fine. Test Plan: Used in workspace KCM Reviewers: ervin Reviewed By: ervin Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25791 --- src/core/kcoreconfigskeleton.cpp | 10 ++++++++++ src/core/kcoreconfigskeleton.h | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/core/kcoreconfigskeleton.cpp b/src/core/kcoreconfigskeleton.cpp index a2b44fde..7566301b 100644 --- a/src/core/kcoreconfigskeleton.cpp +++ b/src/core/kcoreconfigskeleton.cpp @@ -1587,3 +1587,13 @@ void KConfigCompilerSignallingItem::swapDefault() invokeNotifyFunction(); } } + +void KConfigCompilerSignallingItem::setWriteFlags(KConfigBase::WriteConfigFlags flags) +{ + mItem->setWriteFlags(flags); +} + +KConfigBase::WriteConfigFlags KConfigCompilerSignallingItem::writeFlags() const +{ + return mItem->writeFlags(); +} diff --git a/src/core/kcoreconfigskeleton.h b/src/core/kcoreconfigskeleton.h index c6e49c63..0251609d 100644 --- a/src/core/kcoreconfigskeleton.h +++ b/src/core/kcoreconfigskeleton.h @@ -430,6 +430,10 @@ public: QVariant property() const override; void setDefault() override; void swapDefault() override; + // shadow the method in KConfigSkeletonItem, which should be fine for autogenerated code + // KF6 TODO - fix this + void setWriteFlags(KConfigBase::WriteConfigFlags flags); + KConfigBase::WriteConfigFlags writeFlags() const; private: inline void invokeNotifyFunction() { -- cgit v1.2.1