From 55aaa712b75b1401331e29aef08123556b0257f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Wed, 19 Feb 2020 11:13:37 +0100 Subject: Fix isImmutable generated property Summary: Relates to D26368 Test Plan: ctest Reviewers: hchain, ervin, bport, crossi, #frameworks Reviewed By: hchain, crossi Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27496 --- autotests/kconfig_compiler/test13.h.ref | 6 +++--- src/kconfig_compiler/KConfigHeaderGenerator.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/autotests/kconfig_compiler/test13.h.ref b/autotests/kconfig_compiler/test13.h.ref index 6dad0e57..45863900 100644 --- a/autotests/kconfig_compiler/test13.h.ref +++ b/autotests/kconfig_compiler/test13.h.ref @@ -17,7 +17,7 @@ class Test13 : public KConfigSkeleton ~Test13(); Q_PROPERTY(QUrl picturesDir READ picturesDir CONSTANT) - Q_PROPERTY(bool isPicturesDirImmutable CONSTANT) + Q_PROPERTY(bool isPicturesDirImmutable READ isPicturesDirImmutable CONSTANT) /** Get picturesDir */ @@ -46,7 +46,7 @@ class Test13 : public KConfigSkeleton } Q_PROPERTY(double brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) - Q_PROPERTY(bool isBrightnessImmutable CONSTANT) + Q_PROPERTY(bool isBrightnessImmutable READ isBrightnessImmutable CONSTANT) /** Get brightness */ @@ -64,7 +64,7 @@ class Test13 : public KConfigSkeleton } Q_PROPERTY(bool startsWithUppercase READ startsWithUppercase CONSTANT) - Q_PROPERTY(bool isStartsWithUppercaseImmutable CONSTANT) + Q_PROPERTY(bool isStartsWithUppercaseImmutable READ isStartsWithUppercaseImmutable CONSTANT) /** Get StartsWithUppercase */ diff --git a/src/kconfig_compiler/KConfigHeaderGenerator.cpp b/src/kconfig_compiler/KConfigHeaderGenerator.cpp index f6c39b6a..84f89e26 100644 --- a/src/kconfig_compiler/KConfigHeaderGenerator.cpp +++ b/src/kconfig_compiler/KConfigHeaderGenerator.cpp @@ -424,6 +424,7 @@ void KConfigHeaderGenerator::createImmutableProperty(const CfgEntry *entry) } stream() << whitespace(); stream() << "Q_PROPERTY(bool " << immutableFunction(entry->name); + stream() << " READ " << immutableFunction(entry->name); stream() << " CONSTANT)\n"; } -- cgit v1.2.1