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 { 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