From d218b93a535085c85889164d45a83c3a519f9f4b Mon Sep 17 00:00:00 2001 From: Henri Chain Date: Tue, 18 Feb 2020 23:21:30 +0100 Subject: Fix code generation for entries with min/max Summary: - When GenerateProperties and Mutators are activated, the generated code did not handle min/max properly - In the case of a parameterized entry, generated code also did not handle min/max BUG: 418146 Test Plan: - auto tests included Reviewers: meven, crossi, ervin, bport, tcanabrava Reviewed By: meven, ervin Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27497 --- .../test_properties_minmax.cpp.ref | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 autotests/kconfig_compiler/test_properties_minmax.cpp.ref (limited to 'autotests/kconfig_compiler/test_properties_minmax.cpp.ref') diff --git a/autotests/kconfig_compiler/test_properties_minmax.cpp.ref b/autotests/kconfig_compiler/test_properties_minmax.cpp.ref new file mode 100644 index 00000000..1736889b --- /dev/null +++ b/autotests/kconfig_compiler/test_properties_minmax.cpp.ref @@ -0,0 +1,35 @@ +// This file is generated by kconfig_compiler_kf5 from test_properties_minmax.kcfg. +// All changes you do to this file will be lost. + +#include "test_properties_minmax.h" + +TestPropertiesMinMax::TestPropertiesMinMax( KSharedConfig::Ptr config ) + : KConfigSkeleton( std::move( config ) ) +{ + KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast(&TestPropertiesMinMax::itemChanged); + + setCurrentGroup( QStringLiteral( "Something" ) ); + + KConfigCompilerSignallingItem *itemBar; + KConfigSkeleton::ItemInt *innerItemBar; + innerItemBar = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "bar" ), mBar, 42 ); + itemBar = new KConfigCompilerSignallingItem(innerItemBar, this, notifyFunction, signalBarChanged); + innerItemBar->setMinValue(36); + innerItemBar->setMaxValue(102); + addItem( itemBar, QStringLiteral( "bar" ) ); +} + +TestPropertiesMinMax::~TestPropertiesMinMax() +{ +} + + +void TestPropertiesMinMax::itemChanged(quint64 flags) { + + if ( flags & signalBarChanged ) { + Q_EMIT barChanged(); + } +} + +#include "test_properties_minmax.moc" + -- cgit v1.2.1