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

Clear gadget contents when adding new content #70

Merged
merged 1 commit into from
Jun 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions StdGadgetTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,9 @@ void CStdGadgetTree::setContent(int a_contentID)

#ifdef __amigaos__

if (a_contentID == 0)
{
SetGadgetAttrs((struct Gadget *) m_poGadget, NULL, NULL, LISTBROWSER_Labels, (ULONG) NULL, TAG_DONE);
}
else
SetGadgetAttrs((struct Gadget *) m_poGadget, NULL, NULL, LISTBROWSER_Labels, (ULONG) NULL, TAG_DONE);

if (a_contentID != 0)
{
ULONG items = (ULONG) &m_itemsMap[a_contentID];

Expand Down Expand Up @@ -261,6 +259,8 @@ int CStdGadgetTree::setContent(StdList<CTreeNode> &a_items)

QList<QTreeWidgetItem *> items;

while (static_cast<QTreeWidget *>(m_poGadget)->takeTopLevelItem(0)) { }

/* Iterate through the list passed in and, for each item on the list, create a widget item to represent it, */
/* and add it to the tree widget's list of nodes */
CTreeNode *treeNode = a_items.getHead();
Expand Down
Loading