Skip to content

Commit 80e9d3f

Browse files
committed
Support empty enum name.
1 parent eaa3dcc commit 80e9d3f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/kcm/package/contents/ui/EnumOption.qml

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ Row {
3232
Component.onCompleted: {
3333
var i = 0;
3434
while (true) {
35-
var value = properties["Enum"][i.toString()];
36-
if (!value) {
35+
if (!properties.hasOwnProperty("Enum")) {
36+
break;
37+
}
38+
if (!properties["Enum"].hasOwnProperty(i.toString())) {
3739
break;
3840
}
41+
var value = properties["Enum"][i.toString()];
3942
var text = "";
4043
if (properties.hasOwnProperty("EnumI18n")) {
4144
if (properties["EnumI18n"].hasOwnProperty(i.toString())) {

src/kcm/ui/EnumOption.qml

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ Row {
3535
Component.onCompleted: {
3636
var i = 0;
3737
while (true) {
38-
var value = properties["Enum"][i.toString()];
39-
if (!value) {
38+
if (!properties.hasOwnProperty("Enum")) {
39+
break;
40+
}
41+
if (!properties["Enum"].hasOwnProperty(i.toString())) {
4042
break;
4143
}
44+
var value = properties["Enum"][i.toString()];
4245
var text = "";
4346
if (properties.hasOwnProperty("EnumI18n")) {
4447
if (properties["EnumI18n"].hasOwnProperty(i.toString())) {

0 commit comments

Comments
 (0)