Skip to content

fix typo - #3858

Open
dingodoppelt wants to merge 1 commit into
jamulussoftware:mainfrom
dingodoppelt:fix-typo
Open

fix typo#3858
dingodoppelt wants to merge 1 commit into
jamulussoftware:mainfrom
dingodoppelt:fix-typo

Conversation

@dingodoppelt

@dingodoppelt dingodoppelt commented Aug 3, 2026

Copy link
Copy Markdown
Member

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

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@dingodoppelt dingodoppelt added the refactoring Non-behavioural changes, Code cleanup label Aug 3, 2026
Comment thread src/connectdlg.cpp
{
// first remove any existing children
DeleteAllListViewItemChilds ( pCurListViewItem );
DeleteAllListViewItemChildren ( pCurListViewItem );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given it's "...Item" I'd have gone for "...ChildItems".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name was chosen to make clear a list item (as in QTreeListItem, although QTreeWidgetItem is subclassed here) can have children.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It runs a loop doing delete pCurChildItem. So it's iterating over items.

@dingodoppelt dingodoppelt Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Non-behavioural changes, Code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants