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

MainWindow/PaletteWidget: Move palette/translation handling to PaletteWidget #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tetektoza
Copy link
Contributor

@tetektoza tetektoza commented Dec 31, 2024

So, when I've added a new button for clearing whole combobox of palettes or translation palettes, etc. I've found out
we have a lot of duplicated logic for handling our color palettes, and almost all of that logic is the same between MainWindow
and PaletteWidget. I think I've seen it previously as well, but now adding a new button required me to update it in 3 places, for Palette, Translation and UniqTranslation in MainWindow, instead of having all of that stuff in one place, and as it pained me to do so, I've decided for a small refactor.

Basically,

Currently we are splitting the palette/translation handling between MainWindow class and PaletteWidget, so this patch changes that by moving the whole logic for handling color palettes that was contained in MainWindow to PaletteWidget and unifies it, so all of the handling happens here, instead of MainWindow.

I also found a lot of duplicated logic in MainWindow for translation palletes, uniq translation and normal palettes, I've tried to unify it as much as I could.

Note: I'd not name it full refactor, but just part of it, I wanted to at least move 90% of the logic to PaletteWidget. Fixed a couple of potential segfaults, as it seems in some places we were deleting non-existent memory but somehow QPointer didn't throw segfault on that.

Currently we are splitting the palette/translation handling between `MainWindow` class and `PaletteWidget`, so this patch changes that by moving the whole logic for handling color palettes that was contained in MainWindow to PaletteWidget and unifies it, so all of the handling happens here, instead of MainWindow.

I also found a lot of duplicated logic in MainWindow for translation palletes, uniq translation and normal palettes, I've tried to unify it as much as I could.
@tetektoza tetektoza force-pushed the add_clearing_whole_comboboxes branch from 1ce4125 to 948e64a Compare December 31, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant