VirtualBox

Changeset 103178 in vbox


Ignore:
Timestamp:
Feb 2, 2024 3:43:31 PM (12 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10384: UIBootOrderEditor: Take into account that there can be less than 4 devices supported for certain platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIBootOrderEditor.cpp

    r103080 r103178  
    349349UIBootItemDataList UIBootDataTools::loadBootItems(const CMachine &comMachine)
    350350{
     351    /* Acquire supported boot devices: */
    351352    CPlatform comPlatform = comMachine.GetPlatform();
    352353    const KPlatformArchitecture comArch = comPlatform.GetArchitecture();
    353354    const CPlatformProperties comProperties = uiCommon().virtualBox().GetPlatformProperties(comArch);
    354355    QVector<KDeviceType> possibleBootItems = comProperties.GetSupportedBootDevices();
    355     const int iPossibleBootListSize = qMin((ULONG)4, comProperties.GetMaxBootPosition());
     356    /* Limit the list to maximum boot position: */
     357    int iPossibleBootListSize = qMin((ULONG)possibleBootItems.size(), comProperties.GetMaxBootPosition());
     358    /* Limit the list to maximum 4 slots for the GUI: */
     359    iPossibleBootListSize = qMin(4, iPossibleBootListSize);
     360    /* Resize the possible list finally: */
    356361    possibleBootItems.resize(iPossibleBootListSize);
    357362
     
    359364    UIBootItemDataList bootItems;
    360365
    361     /* Gather boot-items of current VM: */
     366    /* Gather boot-items of current VM, they can be different from supported: */
    362367    QList<KDeviceType> usedBootItems;
    363368    for (int i = 1; i <= possibleBootItems.size(); ++i)
     
    373378        }
    374379    }
     380
    375381    /* Gather other unique boot-items: */
    376382    for (int i = 0; i < possibleBootItems.size(); ++i)
    377383    {
    378384        const KDeviceType enmType = possibleBootItems.at(i);
    379         if (!usedBootItems.contains(enmType))
     385        if (   !usedBootItems.contains(enmType)
     386            && enmType != KDeviceType_Null)
    380387        {
    381388            UIBootItemData data;
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