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:
Patryk Osmaczko 2022-07-28 18:52:29 +02:00 committed by osmaczko
parent fb80be7c16
commit 8e31303c6d
1 changed files with 10 additions and 31 deletions

View File

@ -113,37 +113,16 @@ SettingsContentBase {
}
}
inputList: SortFilterProxyModel {
id: languageModel
sourceModel: root.languageStore.languageModel
function imageSourceForEmoji(emoji) {
return StatusQUtils.Emoji.iconSource(emoji)
}
proxyRoles: [
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)
}
]
inputList: root.languageStore.languageModel
proxy {
key: (model) => model.locale
name: (model) => model.name
shortName: (model) => model.native
symbol: (model) => ""
imageSource: (model) => StatusQUtils.Emoji.iconSource(model.flag)
category: (model) => ""
selected: (model) => model.locale === root.languageStore.currentLanguage
setSelected: (model, val) => null // readonly
}
z: root.z + 1