After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770157 - Split ItemManager to have a separate child manager for each mode
Split ItemManager to have a separate child manager for each mode
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks: 690623
 
 
Reported: 2016-08-19 19:49 UTC by Debarshi Ray
Modified: 2018-01-21 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
item-manager: Add photos_item_manager_(un)hide_item (4.41 KB, patch)
2016-08-19 19:52 UTC, Debarshi Ray
committed Details | Review
item-manager: Assert that new items don't have hidden URNs (1.01 KB, patch)
2016-08-19 19:52 UTC, Debarshi Ray
committed Details | Review
item-manager: Remove hidden items that have been deleted out of band (1012 bytes, patch)
2016-08-19 19:53 UTC, Debarshi Ray
committed Details | Review
Use photos_item_manager_(un)hide_item to handle deletes (3.25 KB, patch)
2016-08-19 19:54 UTC, Debarshi Ray
committed Details | Review
preview-nav-buttons: Remove redundant header (755 bytes, patch)
2016-08-19 19:54 UTC, Debarshi Ray
committed Details | Review
base-manager: Make get_object_by_id a virtual method (2.96 KB, patch)
2016-08-19 19:55 UTC, Debarshi Ray
committed Details | Review
base-manager: Make get_active_object a virtual method (2.56 KB, patch)
2016-08-19 19:56 UTC, Debarshi Ray
committed Details | Review
base-manager: Make get_objects a virtual method (2.70 KB, patch)
2016-08-19 19:57 UTC, Debarshi Ray
committed Details | Review
base-manager: Add photos_base_manager_new (1.50 KB, patch)
2016-08-19 19:58 UTC, Debarshi Ray
committed Details | Review
item-manager: Add an array of child BaseManagers for each WindowMode (2.63 KB, patch)
2016-08-19 19:58 UTC, Debarshi Ray
committed Details | Review
Split ItemManager to have a separate child manager for each mode (18.87 KB, patch)
2016-08-19 19:59 UTC, Debarshi Ray
none Details | Review
Split ItemManager to have a separate child manager for each mode (19.25 KB, patch)
2016-08-20 17:28 UTC, Debarshi Ray
committed Details | Review
item-manager: Fix typo (1.11 KB, patch)
2018-01-21 12:12 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-08-19 19:49:08 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.
Comment 1 Debarshi Ray 2016-08-19 19:52:19 UTC
Created attachment 333696 [details] [review]
item-manager: Add photos_item_manager_(un)hide_item
Comment 2 Debarshi Ray 2016-08-19 19:52:51 UTC
Created attachment 333697 [details] [review]
item-manager: Assert that new items don't have hidden URNs
Comment 3 Debarshi Ray 2016-08-19 19:53:23 UTC
Created attachment 333698 [details] [review]
item-manager: Remove hidden items that have been deleted out of band
Comment 4 Debarshi Ray 2016-08-19 19:54:10 UTC
Created attachment 333699 [details] [review]
Use photos_item_manager_(un)hide_item to handle deletes
Comment 5 Debarshi Ray 2016-08-19 19:54:54 UTC
Created attachment 333700 [details] [review]
preview-nav-buttons: Remove redundant header
Comment 6 Debarshi Ray 2016-08-19 19:55:36 UTC
Created attachment 333701 [details] [review]
base-manager: Make get_object_by_id a virtual method
Comment 7 Debarshi Ray 2016-08-19 19:56:52 UTC
Created attachment 333702 [details] [review]
base-manager: Make get_active_object a virtual method
Comment 8 Debarshi Ray 2016-08-19 19:57:27 UTC
Created attachment 333703 [details] [review]
base-manager: Make get_objects a virtual method
Comment 9 Debarshi Ray 2016-08-19 19:58:02 UTC
Created attachment 333704 [details] [review]
base-manager: Add photos_base_manager_new
Comment 10 Debarshi Ray 2016-08-19 19:58:31 UTC
Created attachment 333705 [details] [review]
item-manager: Add an array of child BaseManagers for each WindowMode
Comment 11 Debarshi Ray 2016-08-19 19:59:04 UTC
Created attachment 333706 [details] [review]
Split ItemManager to have a separate child manager for each mode
Comment 12 Debarshi Ray 2016-08-19 20:04:54 UTC
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.
Comment 13 Debarshi Ray 2016-08-20 17:27:13 UTC
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.
Comment 14 Debarshi Ray 2016-08-20 17:28:29 UTC
Created attachment 333768 [details] [review]
Split ItemManager to have a separate child manager for each mode
Comment 15 Debarshi Ray 2016-08-20 17:34:48 UTC
I have merged this into master. Let us know if there is any breakage.
Comment 16 Debarshi Ray 2018-01-21 12:12:42 UTC
Created attachment 367169 [details] [review]
item-manager: Fix typo