GNOME Bugzilla – Bug 770157
Split ItemManager to have a separate child manager for each mode
Last modified: 2018-01-21 18:56:53 UTC
We have this strange situation where each mode/view issues its separate SPARQL query, but then the results of those queries get mixed up in one single bucket inside PhotosItemManager. Then PhotosViewModel re-filters the bucket based on the purpose of each mode. This means that the rules governing each mode are encoded both in the SPARQL queries and inside PhotosViewModel. Instead, we should ensure that the results of the queries are never mixed up by keeping them in separate buckets. We can do this by splitting ItemManager to have a separate child manager for each mode. Simplifying the ViewModel logic is a significant step towards a GtkFlowBox port.
Created attachment 333696 [details] [review] item-manager: Add photos_item_manager_(un)hide_item
Created attachment 333697 [details] [review] item-manager: Assert that new items don't have hidden URNs
Created attachment 333698 [details] [review] item-manager: Remove hidden items that have been deleted out of band
Created attachment 333699 [details] [review] Use photos_item_manager_(un)hide_item to handle deletes
Created attachment 333700 [details] [review] preview-nav-buttons: Remove redundant header
Created attachment 333701 [details] [review] base-manager: Make get_object_by_id a virtual method
Created attachment 333702 [details] [review] base-manager: Make get_active_object a virtual method
Created attachment 333703 [details] [review] base-manager: Make get_objects a virtual method
Created attachment 333704 [details] [review] base-manager: Add photos_base_manager_new
Created attachment 333705 [details] [review] item-manager: Add an array of child BaseManagers for each WindowMode
Created attachment 333706 [details] [review] Split ItemManager to have a separate child manager for each mode
I have been working on this patchset with Umang for a while, and it seems somewhat stable now. Since we are short on time for the GNOME 3.22 release, I am going to merge this sooner rather than later. However, testing and reviews are still welcome.
Review of attachment 333706 [details] [review]: ::: src/photos-item-manager.c @@ +47,3 @@ { PhotosBaseManager parent_instance; + GObject *active_object; Needs to be unreffed during dispose.
Created attachment 333768 [details] [review] Split ItemManager to have a separate child manager for each mode
I have merged this into master. Let us know if there is any breakage.
Created attachment 367169 [details] [review] item-manager: Fix typo