Bug 436712

Summary: kconfig_compiler generates invalid code
Product: [Frameworks and Libraries] frameworks-kconfig Reporter: Nicolas Fella <nicolas.fella>
Component: generalAssignee: Matthew Dawson <matthew>
Status: REPORTED ---    
Severity: normal CC: a.samirh78, faure, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nicolas Fella 2021-05-06 22:47:11 UTC
Consider this .kcfg file:

<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
  <kcfgfile name="foo" />
  <group name="General">
    <entry name="Bar" type="Enum">
      <choices>
          <choice name="Bla" value="bla" />
       </choices>
     </entry>
  </group>
</kcfg>

and this .kcfgc:

File=foo.kcfg
ClassName=FooSettings
Mutators=true
GenerateProperties=true

The build fails with

foosettings.cpp:23:12: error: no member named 'setValueForChoice' in 'KConfigCompilerSignallingItem'
  itemBar->setValueForChoice(QStringLiteral( "Bla" ), QStringLiteral( "bla" ));