Bug 366418

Summary: Config entries of type "Enum" do not work with "property alias cfg_entryName: comboBox.currentIndex"
Product: [Frameworks and Libraries] libplasma Reporter: Friedrich W. H. Kossebau <kossebau>
Component: libplasmaAssignee: Marco Martin <notmart>
Status: REPORTED ---    
Severity: normal CC: nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.24.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Friedrich W. H. Kossebau 2016-08-04 18:24:16 UTC
When using a config entry of type Enum, e.g. like this:
--- 8< --- main.xml
<?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=""/>

  <group name="General">
    <entry name="projection" type="Enum">
        <choices>
          <choice name="Equirectangular" />
          <choice name="Mercator" />
        </choices>
        <default>Equirectangular</default>
    </entry>
  </group>

</kcfg>
--- 8< --- main.xml
then using an alias property binding like the following does not work:
--- 8< --- config.qml
    // [...]
    property alias cfg_projection: projectionComboBox.currentIndex
    // [...]
        QtControls.ComboBox {
            id: projectionComboBox
            model: [
                i18n("Equirectangular"),
                i18n("Mercator")
            ]
        }
    // [...]
--- 8< --- config.qml
Which would be nice to have, as that alias-binding just works nicely for config entries of type "int". 

Even more, as the following work-around does work, and just seems the explicit version of the alias:
--- 8< --- config.qml
    // [...]
    property int cfg_projection: plasmoid.configuration.projection
    // [...]
        QtControls.ComboBox {
            id: projectionComboBox
            model: [
                i18n("Equirectangular"),
                i18n("Mercator")
            ]
            onCurrentIndexChanged: {
                cfg_projection = currentIndex;
            }
            Component.onCompleted: {
                currentIndex = plasmoid.configuration.projection;
            }
        }
    // [...]
--- 8< --- config.qml


Reproducible: Always