Skip to content
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

Merged
merged 43 commits into from
May 26, 2024
Merged

Image list cleanup #2488

merged 43 commits into from
May 26, 2024

Commits on May 23, 2024

  1. Move picard.ui.item to picard.item

    - 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
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    ebf6bfe View commit details
    Browse the repository at this point in the history
  2. Introduce MetadataItem as a subclass of Item

    It defines:
    - metadata & orig_metadata properties
    - metadata_images_changed signal
    - move methods related to metadata from FileListItem to it
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    e246eaa View commit details
    Browse the repository at this point in the history
  3. Move remove_metadata_images() from imagelist to MetadataItem

    - it doesn't belong here anyway
    - it depends on an object passed as obj -> self
    - transitional: local imports
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    6db8ae5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    df8fa5f View commit details
    Browse the repository at this point in the history
  5. Move update_metadata_images() from imagelist to MetadataItem.metadata…

    …item_update_metadata_images()
    
    The long name is to avoid conflicts with existing update_metadata_images() in Album/Cluster
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    1c75c82 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    18e8a24 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c6dde74 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    24cacb9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8ff5f7a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3ce951b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8111f4f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2aa4e12 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    84f4ca3 View commit details
    Browse the repository at this point in the history
  14. Define new get_imagelist_state() in Album & FileListItem

    Called from MetadataItem._get_imagelist_state()
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    741be95 View commit details
    Browse the repository at this point in the history
  15. Define update_new/orig_metadata in MetadataItem and its subclasses

    Then pass them to ImageListState() constructor
    Those don't change, and are only set to True for Album & FileItem
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    ab463c6 View commit details
    Browse the repository at this point in the history
  16. Replace get_imagelist_state() by a generator and set ImageListState.s…

    …ources using it
    
    It is much cleaner.
    The new method is named `children_metadata_items()`
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    2ce5470 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    8a184d0 View commit details
    Browse the repository at this point in the history
  18. Replace update_new/orig_metadata by a set

    Compatibility preserved defining matching `@property`, that's transitional
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    8c22dd0 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    77b3b51 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    2c61644 View commit details
    Browse the repository at this point in the history
  21. get_sources_metadata_images(): move at module level as it doesn't dep…

    …end on ImageListState
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    e5bae38 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    543a4f4 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    f41e86d View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    3a46081 View commit details
    Browse the repository at this point in the history
  25. Split ImageListState.process_images() in two methods

    - move check for src_obj instance in caller
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    bef084f View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    1b8294d View commit details
    Browse the repository at this point in the history
  27. Make ImageListState more generic, and greatly simplify code

    - 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
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    7223de0 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    99b8e60 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    df0f11c View commit details
    Browse the repository at this point in the history
  30. Introduce iter_children_items_metadata() and finally make the code de…

    …duplication possible
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    492bfea View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    6743b42 View commit details
    Browse the repository at this point in the history
  32. Reduce code redundancy

    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    84445b1 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    d45dd9b View commit details
    Browse the repository at this point in the history
  34. ImageList._changed -> _dirty

    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    86ba49a View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    6d1c10b View commit details
    Browse the repository at this point in the history
  36. ImageList.insert(): no need to return anything

    list.insert() doesn't return anything either
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    1fa2168 View commit details
    Browse the repository at this point in the history
  37. Make get_sources_metadata_images() a static method of MetadataItem

    And get rid of imports
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    5ad0640 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    8e09dfc View commit details
    Browse the repository at this point in the history
  39. Make remove_metadata_images() returns a boolean indicating changes li…

    …ke similar methods
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    df00e45 View commit details
    Browse the repository at this point in the history
  40. Also test return values

    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    8ca7f2c View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    8920c41 View commit details
    Browse the repository at this point in the history
  42. add_metadata_images() -> add_metadata_images_from_children()

    It does what it says.
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    75bfb1c View commit details
    Browse the repository at this point in the history
  43. remove_metadata_images() -> remove_metadata_images_from_children()

    Not perfect, but it used the same scheme as other methods in this group at least
    zas committed May 23, 2024
    Configuration menu
    Copy the full SHA
    d46d4bb View commit details
    Browse the repository at this point in the history