-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 an option to delete unused categories in the categorized symbol renderer widget #60641
Merged
troopa81
merged 7 commits into
qgis:master
from
benwirf:delete_unused_renderer_categories
Feb 23, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3b9a5f8
Add an option via a button in the categorized symbol renderer widget …
benwirf e535205
Rebase and incorporate suggestions from review
benwirf 1d51900
sipify
benwirf 862ebe1
Trying to fix ui file
benwirf cc1e3d4
install pre-commit hooks and fix ui file
benwirf dc70921
sipify
benwirf c159e7c
apply suggestions from review
benwirf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You have à memory leak here, please use std::unique_ptr here or remove the ptr .
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.
Ok, I have no problem with these suggestions and I'm happy to make these changes, but please note that this is part of the block of code which I reused from the existing
addCategories()
method. I.e. this code is in the current master branch:QGIS/src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
Line 908 in 8789841
Again, I'm happy to change it as part of this PR- is there anything else that you think should be modified here?
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.
Ideally, I would have spotted during my first review , but thank you for making the modification, one less memory leak.
Lgtm
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.
Absolutely! Thanks again for your help @troopa81.
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.
Hi @troopa81, even though this PR is closed I just wanted to leave this here as a follow up. Firstly, I appreciate the time you gave me here- I should have picked these things up myself! As you can probably tell I'm fairly inexperienced in C++, but your reviews here prompted me to think/learn a bit more about memory management, heap/stack allocation etc. and to be a bit more analytical/critical when modifying existing QGIS code which will help me to submit better PRs in the future. So I just wanted to say thank you.
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.
@benwirf You're welcome! I'm always happy to see new contributors. Keep up the good work