Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libcommhistory] Consolidate contact/recipient event models and fix u…
…nit tests. JB#48263 Remove SingleContactEventModel; move its features into RecipientEventModel, which now accepts either recipients or a contact id as the event filter. We can do without the class split for filtering events by saved vs non-saved contacts, and combining these into a single model simplifies the code base. RecipientEventModel can resolve contacts into recipients and also recipients into contacts (for e.g. when a recipient matches a contact that has multiple phone numbers). Instead of having multiple getEvents() functions, it now has setRecipients() functions to set the filter, then getEvents() can be called to execute the query. Remove ContactEventModel, and add DeclarativeRecipientEventModel as a QML wrapper around RecipientEventModel. Fix various issues in the unit tests where contact creation/editing were failing as they were operating on aggregates (which are read-only) rather than local constituents (which are writable). The unit tests in SingleContactEventModelTest have been moved into RecipientEventModelTest. The unit tests now modify the main contacts database directly instead of creating a separate test database. This avoids test failures where the tests are accessing a QContactManager instance that is different from the one accessed via the SeasideCache in the library (to resolve contacts, for example).
- Loading branch information
Showing
23 changed files
with
489 additions
and
659 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.