@@ -8,6 +8,7 @@ import QtQuick
8
8
import QtQuick.Layouts
9
9
import QtQuick.Controls
10
10
import org.kde.kirigami as Kirigami
11
+ import "utils.js" as Utils
11
12
12
13
ColumnLayout {
13
14
id: listOption
@@ -36,7 +37,7 @@ ColumnLayout {
36
37
}
37
38
var i = 0 ;
38
39
while (true ) {
39
- if (! rawValue . hasOwnProperty ( i .toString ())) {
40
+ if (! Utils . hasProperty (rawValue, i .toString ())) {
40
41
break ;
41
42
}
42
43
var value = rawValue[i .toString ()];
@@ -59,12 +60,12 @@ ColumnLayout {
59
60
var i = 0 ;
60
61
var enumMap = {};
61
62
while (true ) {
62
- if (! properties .Enum . hasOwnProperty ( i .toString ())) {
63
+ if (! Utils . hasProperty ( properties .Enum , i .toString ())) {
63
64
break ;
64
65
}
65
66
var enumString = properties .Enum [i .toString ()];
66
67
var text = enumString;
67
- if (properties . hasOwnProperty ( " EnumI18n" ) && properties .EnumI18n . hasOwnProperty ( i .toString ())) {
68
+ if (Utils . hasProperty (properties, " EnumI18n" ) && Utils . hasProperty ( properties .EnumI18n , i .toString ())) {
68
69
text = properties .EnumI18n [i .toString ()];
69
70
}
70
71
enumMap[enumString] = text;
@@ -76,15 +77,15 @@ ColumnLayout {
76
77
subSubType = subType .substr (5 );
77
78
var strs = [];
78
79
while (true ) {
79
- if (! value . hasOwnProperty ( i .toString ())) {
80
+ if (! Utils . hasProperty (value, i .toString ())) {
80
81
break ;
81
82
}
82
83
var subValue = prettify (value[i .toString ()]);
83
84
strs .push (subValue);
84
85
i++ ;
85
86
}
86
87
return i18n (" [%1]" , strs .join (" " ));
87
- } else if (configPage .typeMap . hasOwnProperty ( subType)) {
88
+ } else if (Utils . hasProperty ( configPage .typeMap , subType)) {
88
89
for (var i = 0 ; i < configPage .typeMap [subTypeName].length ; ++ i) {
89
90
var option = configPage .typeMap [subTypeName][i];
90
91
if (option .name .length === 1 && option .name [0 ] === properties .ListDisplayOption ) {
@@ -198,7 +199,7 @@ ColumnLayout {
198
199
Kirigami .OverlaySheet {
199
200
id: sheet
200
201
property int editIndex: - 1
201
- readonly property bool isSubConfig: configPage .typeMap . hasOwnProperty ( subTypeName)
202
+ readonly property bool isSubConfig: Utils . hasProperty ( configPage .typeMap , subTypeName)
202
203
203
204
parent: configPage
204
205
0 commit comments