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
Add support for 1200 px CAA thumbnail size #833
Conversation
- size was stored as index in the combo box - items were set in .ui, not dynamically built - QtDesigner doesn't support setting user data to QComboBox items - compatibility preserved using a trick: any value between 0 and 2 is old way, new way uses -1 and values >= 250 - safe default if value is outside range is read from config file - fallback on smaller thumbnails if desired size isn't available
self.ui.cb_image_size.addItem(_(item.label), userData=item_id) | ||
|
||
size = config.setting["caa_image_size"] | ||
if size in _CAA_SIZE_COMPAT: |
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.
Rather than introducing this, wouldn't it be better to just have a upgrade hook?
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.
It was to avoid an upgrade hook. I pondered both approaches, and this one is much simpler and reliable.
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.
I just feel that this more of a compat issue with picard versions and should be kept in upgrade hooks, it makes it easier to track config errors. This approach adds unrelated code to the view IMHO.
Also, why are plugin hooks unreliable or this approach more reliable?
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.
Mostly because upgrade hooks don't work well when someone switch between versions, this code would handle a switch, or even a buggy entry.
This is perfectly possible to do with an upgrade hook though, feel free to propose a patch.
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.
LGTM apart from my comment above.
Summary
Add support for 1200 px CAA thumbnail size
Problem
Solution
Action
Review & test