VirtualBox

Changeset 60878 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 7, 2016 6:42:49 PM (9 years ago)
Author:
vboxsync
Message:

UINameAndSystemEditor::setType: Quick fix for new-vm-wizard assertions due to type.isNull() == true.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp

    r60834 r60878  
    252252void UINameAndSystemEditor::setType(const CGuestOSType &type)
    253253{
    254     /* Initialize variables: */
    255     const QString strFamilyId = type.GetFamilyId();
    256     const QString strTypeId = type.GetId();
    257 
    258     /* Get/check family index: */
    259     const int iFamilyIndex = m_pComboFamily->findData(strFamilyId, TypeID);
    260     AssertMsg(iFamilyIndex != -1, ("Invalid family ID: '%s'", strFamilyId.toLatin1().constData()));
    261     if (iFamilyIndex != -1)
    262         m_pComboFamily->setCurrentIndex(iFamilyIndex);
    263 
    264     /* Get/check type index: */
    265     const int iTypeIndex = m_pComboType->findData(strTypeId, TypeID);
    266     AssertMsg(iTypeIndex != -1, ("Invalid type ID: '%s'", strTypeId.toLatin1().constData()));
    267     if (iTypeIndex != -1)
    268         m_pComboType->setCurrentIndex(iTypeIndex);
     254    /** @todo We're getting here with a NULL type when creating new VMs.  Very
     255     *        annoying, so I've just shut it up for now.  Sergey and Santosh can try
     256     *        figure out why this happens now with Qt5. */
     257    if (type.isNotNull())
     258    {
     259        /* Initialize variables: */
     260        const QString strFamilyId = type.GetFamilyId();
     261        const QString strTypeId = type.GetId();
     262
     263        /* Get/check family index: */
     264        const int iFamilyIndex = m_pComboFamily->findData(strFamilyId, TypeID);
     265        AssertMsg(iFamilyIndex != -1, ("Invalid family ID: '%s'", strFamilyId.toLatin1().constData()));
     266        if (iFamilyIndex != -1)
     267            m_pComboFamily->setCurrentIndex(iFamilyIndex);
     268
     269        /* Get/check type index: */
     270        const int iTypeIndex = m_pComboType->findData(strTypeId, TypeID);
     271        AssertMsg(iTypeIndex != -1, ("Invalid type ID: '%s'", strTypeId.toLatin1().constData()));
     272        if (iTypeIndex != -1)
     273            m_pComboType->setCurrentIndex(iTypeIndex);
     274    }
    269275}
    270276
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