fix(settings): remove usage of proxyRoles
- SortFilterProxyModel::proxyRoles have big performance impact, don't use it util it's fixed
This commit is contained in:
parent
fb80be7c16
commit
8e31303c6d
|
@ -113,37 +113,16 @@ SettingsContentBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inputList: SortFilterProxyModel {
|
inputList: root.languageStore.languageModel
|
||||||
id: languageModel
|
proxy {
|
||||||
|
key: (model) => model.locale
|
||||||
sourceModel: root.languageStore.languageModel
|
name: (model) => model.name
|
||||||
|
shortName: (model) => model.native
|
||||||
function imageSourceForEmoji(emoji) {
|
symbol: (model) => ""
|
||||||
return StatusQUtils.Emoji.iconSource(emoji)
|
imageSource: (model) => StatusQUtils.Emoji.iconSource(model.flag)
|
||||||
}
|
category: (model) => ""
|
||||||
|
selected: (model) => model.locale === root.languageStore.currentLanguage
|
||||||
proxyRoles: [
|
setSelected: (model, val) => null // readonly
|
||||||
ExpressionRole {
|
|
||||||
name: "key"
|
|
||||||
expression: model.locale
|
|
||||||
},
|
|
||||||
ExpressionRole {
|
|
||||||
name: "shortName"
|
|
||||||
expression: model.native
|
|
||||||
},
|
|
||||||
ExpressionRole {
|
|
||||||
name: "category"
|
|
||||||
expression: ""
|
|
||||||
},
|
|
||||||
ExpressionRole {
|
|
||||||
name: "selected"
|
|
||||||
expression: model.locale == root.languageStore.currentLanguage
|
|
||||||
},
|
|
||||||
ExpressionRole {
|
|
||||||
name: "imageSource"
|
|
||||||
expression: languageModel.imageSourceForEmoji(model.flag)
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
z: root.z + 1
|
z: root.z + 1
|
||||||
|
|
Loading…
Reference in New Issue