fix typo - #3858
Open
dingodoppelt wants to merge 1 commit into
Open
Conversation
softins
approved these changes
Aug 3, 2026
pljones
reviewed
Aug 3, 2026
| { | ||
| // first remove any existing children | ||
| DeleteAllListViewItemChilds ( pCurListViewItem ); | ||
| DeleteAllListViewItemChildren ( pCurListViewItem ); |
Collaborator
There was a problem hiding this comment.
Given it's "...Item" I'd have gone for "...ChildItems".
Member
Author
There was a problem hiding this comment.
I think the name was chosen to make clear a list item (as in QTreeListItem, although QTreeWidgetItem is subclassed here) can have children.
Collaborator
There was a problem hiding this comment.
It runs a loop doing delete pCurChildItem. So it's iterating over items.
Member
Author
There was a problem hiding this comment.
void CConnectDlg::DeleteAllListViewItemChilds ( QTreeWidgetItem* pItem )
{
// loop over all children
while ( pItem->childCount() > 0 )
{
// get the first child in the list
QTreeWidgetItem* pCurChildItem = pItem->child ( 0 );
// remove it from the item (note that the object is not deleted)
pItem->removeChild ( pCurChildItem );
// delete the object to avoid a memory leak
delete pCurChildItem;
}
}
Maybe ChildItem is the misnomer then. I still think the order should be Item->Children. I think the item needs to go (pCurChild) and that would make it clearer, because we already are an item and we iterate over our children.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Short description of changes
Fix a typo
CHANGELOG:
Context: Fixes an issue?
No
Does this change need documentation? What needs to be documented and how?
No
Status of this Pull Request
Ready to merge
Checklist