-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor contacts' user models to have only one model that is filtered on the UI side #16549
Milestone
Comments
Also, the way we update items is very bad. We remove all items from the models and then replace them with new items. That is highly ineffective proc removeIfExistsAndAddToAppropriateModel(self: Module, publicKey: string) =
self.removeItemWithPubKeyFromAllModels(publicKey)
let item = self.createItemFromPublicKey(publicKey)
self.addItemToAppropriateModel(item) |
jrainville
added a commit
that referenced
this issue
Oct 29, 2024
Fixes #16549 Refactors the 5 types of contact models (all, mutuals, banned, received and sent) into only the `allContacts` and use an Adaptor on the QML side to filter into the needed models. This cleans the Nim side a lot and makes applying updates to the contacts' model way simpler.
jrainville
added a commit
that referenced
this issue
Oct 30, 2024
Fixes #16549 We used to update contact items by removing them from the models and re-adding them. This is highly inefficient. Instead, the proper way is to update only the values that changed.
3 tasks
jrainville
added a commit
that referenced
this issue
Oct 31, 2024
Fixes #16549 We used to update contact items by removing them from the models and re-adding them. This is highly inefficient. Instead, the proper way is to update only the values that changed.
Seems to be duplicate of #14966 |
jrainville
added a commit
that referenced
this issue
Oct 31, 2024
Fixes #16549 Refactors the 5 types of contact models (all, mutuals, banned, received and sent) into only the `allContacts` and use an Adaptor on the QML side to filter into the needed models. This cleans the Nim side a lot and makes applying updates to the contacts' model way simpler. rthh
jrainville
added a commit
that referenced
this issue
Oct 31, 2024
Fixes #16549 We used to update contact items by removing them from the models and re-adding them. This is highly inefficient. Instead, the proper way is to update only the values that changed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Similar to #16433
In the contacts module, there are 5 models for the different types of contacts:
All those models could be deleted and we only keep
contactsModel
and then use SortFilterProxyModels on the QML side to filter the right contacts for the different lists.The text was updated successfully, but these errors were encountered: