Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nemo-qml-plugin-calendar] Prevent flicker of attendees. Contributes …
…to JB#32993 The CalendarWorker observes storageModified() signals sent from mkcal. In mkcal side, when storageModified() is emitted, loaded ranges are invalidated and must be re-loaded. Thus, when CalendarWorker observes the storageModified() signal, it tells the CalendarManager that it needs to rebuild its required ranges (from connected AgendaModel and currently active EventQuery instances). The CalendarManager then asks the CalendarWorker to load instances within that range into the calendar from storage. If an EventQuery is refreshed as part of this process, it previously always emitted attendeesChanged() even if the data in the backend remained the same. This commit ensures that we load the data from the backend, and compare it to the currently cached data, and only emit attendeesChanged() if they are indeed different. Finally, it guards against a race condition case where if multiple storageModified() signals are received in sequence, the some attempts to load the attendees may fail due to the storage having invalidated its loaded ranges. In this case, the results we receive back will be invalid, and should be ignored (and in this case, the data for the event will be reloaded again, as triggered by storageModified()).
- Loading branch information
Chris Adams
committed
Mar 27, 2020
1 parent
9c36ae2
commit 1ba0729
Showing
4 changed files
with
48 additions
and
18 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