-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Image list cleanup #2488
Image list cleanup #2488
Conversation
42e08b2
to
a2c1ea5
Compare
- classes defined here are mainly used at top level - they aren't specific to UI, as they are used to define important classes like Cluster, Album, etc... - there's not even any Qt import in there
It defines: - metadata & orig_metadata properties - metadata_images_changed signal - move methods related to metadata from FileListItem to it
- it doesn't belong here anyway - it depends on an object passed as obj -> self - transitional: local imports
…item_update_metadata_images() The long name is to avoid conflicts with existing update_metadata_images() in Album/Cluster
Called from MetadataItem._get_imagelist_state()
Then pass them to ImageListState() constructor Those don't change, and are only set to True for Album & FileItem
…ources using it It is much cleaner. The new method is named `children_metadata_items()`
Compatibility preserved defining matching `@property`, that's transitional
…end on ImageListState
- move check for src_obj instance in caller
- it is (now) only used in update_metadata_images_from_children() - drop now unused _get_imagelist_state() - it opens the door to even more code duplication reduction
…duplication possible
list.insert() doesn't return anything either
And get rid of imports
…ke similar methods
It does what it says.
Not perfect, but it used the same scheme as other methods in this group at least
@zas I started reviewing, but I'm not through it yet. But so far this looks really good. About the issue with The We can do this in a separate refactoring, but here is my short comment on the class DataObject(LockableObject):
def __init__(self, obj_id):
super().__init__()
self.id = obj_id # Probably best placed in MetadataItem
self.item = None # I think this should go to Item, likely with a different name (ui_item ?)
self._genres = Counter() # -> MetadataItem
@property
def genres(self): # -> MetadataItem
...
def add_genre(self, name, count): # -> MetadataItem
...
@staticmethod
def set_genre_inc_params(inc, config=None): # -> MetadataItem
... |
I agree, let's first merge this and then we can fix that. This PR is big enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great move. While reviewing the commits I had a couple of comments, but they were all addressed later on.
I'd be in favor of avoiding inline declaration. I think it harms readability. Also the type is recreated on every function call, which seems wasteful.
Apart from that LGTM.
Summary
Problem
Solution
Action
Additional actions required: