VirtualBox

Changeset 78545 in vbox for trunk/src


Ignore:
Timestamp:
May 16, 2019 12:47:28 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
130591
Message:

FE/Qt: bugref:6247: VM Settings / Storage page: Make sure each of remaining attachments has valid storage slot according to new controller bus type.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r78542 r78545  
    16981698                if (pItem->rtti() == AbstractItem::Type_ControllerItem)
    16991699                {
     1700                    /* Acquire controller item and requested storage bus type: */
    17001701                    ControllerItem *pItemController = static_cast<ControllerItem*>(pItem);
    17011702                    const KStorageBus enmNewCtrBusType = aValue.value<KStorageBus>();
     
    17291730                    }
    17301731
     1732                    /* Push new controller type: */
    17311733                    pItemController->setCtrBusType(enmNewCtrBusType);
    17321734                    emit dataChanged(aIndex, aIndex);
     1735
     1736                    /* Make sure each of remaining attachments has valid slot: */
     1737                    foreach (AbstractItem *pChildItem, pItemController->attachments())
     1738                    {
     1739                        AttachmentItem *pChildItemAttachment = static_cast<AttachmentItem*>(pChildItem);
     1740                        const SlotsList availableSlots = pChildItemAttachment->attSlots();
     1741                        const StorageSlot currentSlot = pChildItemAttachment->attSlot();
     1742                        if (!availableSlots.isEmpty() && !availableSlots.contains(currentSlot))
     1743                            pChildItemAttachment->setAttSlot(availableSlots.first());
     1744                    }
     1745
     1746                    /* This means success: */
    17331747                    return true;
    17341748                }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r78539 r78545  
    281281    QList<QUuid> attachmentIDs(KDeviceType enmType = KDeviceType_Null) const;
    282282
     283    QList<AbstractItem*> attachments() const { return mAttachments; }
    283284    void setAttachments(const QList<AbstractItem*> &attachments) { mAttachments = attachments; }
    284285
Note: See TracChangeset for help on using the changeset viewer.

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