- Remove strings m_searchName in the destructor of the ListItem class.
- Use the same object for transparent colors/icons.
- Add the Deselect flag in item sections.
Details
Details
- Reviewers
dhaumann cullmann - Group Reviewers
KTextEditor - Commits
- R39:f1d9f086da6f: KadeModeMenuList: fix memory leaks and others
Diff Detail
Diff Detail
- Repository
- R39 KTextEditor
- Branch
- fix-mode-menu
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 17036 Build 17054: arc lint + arc unit
Comment Actions
I must confess the m_searchName deletion condition seems for me too be overly complex.
Given QString copying is cheap, can't we just always set that and store it inline as value?
Comment Actions
- Update
- Add boolean m_bHasNewSearchName to verify removal of m_searchName.
- Correct format in some comments.
- Remove friend KateModeMenuList and replace it with the "Factory" class.
Comment Actions
m_searchName is a pointer to an attribute of a KateFileType object (which may be the string translatedName or name), but in some cases a new string is created.
I added the boolean m_bHasNewSearchName that is true when a new QString is created for search. This is much simpler.
Still, if you don't like it and prefer to use inline attributes, I can change it without problems =)
Comment Actions
I would prefer just some QString m_searchName, strings are shared anyways, no need to try to save there a few bytes but then introduce more heap allocated things.