VirtualBox

Changeset 84574 in vbox


Ignore:
Timestamp:
May 27, 2020 4:50:49 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138304
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Cleanup for group disband functionality; There can't be a collision between local and cloud provider groups; Adding a bit of comments to clarify the situation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r84569 r84574  
    597597        return;
    598598
    599     /* Check if we have collisions with our potential siblings: */
     599    /* Check if we have collisions between disbandable group children and their potential siblings: */
    600600    UIChooserItem *pCurrentItem = currentItem();
    601601    UIChooserNode *pCurrentNode = pCurrentItem->node();
     
    605605    foreach (UIChooserNode *pChildNode, pCurrentNode->nodes())
    606606    {
     607        /* Acquire disbandable group child name to check for collision with group siblings: */
    607608        const QString strChildName = pChildNode->name();
    608609        UIChooserNode *pCollisionSibling = 0;
     610        /* And then compare this child name with all the sibling names: */
    609611        foreach (UIChooserNode *pSiblingNode, pParentNode->nodes())
     612        {
     613            /* There can't be a collision between local child and cloud provider sibling: */
     614            if (   pSiblingNode->type() == UIChooserNodeType_Group
     615                && pSiblingNode->toGroupNode()->groupType() == UIChooserNodeGroupType_Provider)
     616                continue;
     617            /* If sibling isn't disbandable group itself and has name similar to one of group children: */
    610618            if (pSiblingNode != pCurrentNode && pSiblingNode->name() == strChildName)
    611619            {
     620                /* We have a collision sibling: */
    612621                pCollisionSibling = pSiblingNode;
    613622                break;
    614623            }
     624        }
     625        /* If there is a collision sibling: */
    615626        if (pCollisionSibling)
    616627        {
    617628            switch (pChildNode->type())
    618629            {
     630                /* We can't resolve collision automatically for VMs: */
    619631                case UIChooserNodeType_Machine:
    620632                {
     
    622634                    return;
    623635                }
     636                /* But we can do it for VM groups: */
    624637                case UIChooserNodeType_Group:
    625638                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette