VirtualBox

Changeset 101264 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Sep 26, 2023 10:51:10 AM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10523. Don't cache UIGuestOSType object when all we need is guest os type Id.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings
Files:
3 edited

Legend:

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

    r101263 r101264  
    4545    : UIEditor(pParent)
    4646    , m_iValue(0)
    47     , m_guestOSType(UIGuestOSTypeII())
    4847    , m_cGuestScreenCount(1)
    4948    , m_enmGraphicsControllerType(KGraphicsControllerType_Null)
     
    8584}
    8685
    87 void UIVideoMemoryEditor::setGuestOSType(const UIGuestOSTypeII &guestOSType)
    88 {
    89     /* Update cached value and
    90      * requirements if value has changed: */
    91     if (m_guestOSType != guestOSType)
     86void UIVideoMemoryEditor::setGuestOSTypeId(const QString &strGuestOSTypeId)
     87{
     88    /* Update cached value and
     89     * requirements if value has changed: */
     90    if (m_strGuestOSTypeId != strGuestOSTypeId)
    9291    {
    9392        /* Remember new guest OS type: */
    94         m_guestOSType = guestOSType;
     93        m_strGuestOSTypeId = strGuestOSTypeId;
    9594
    9695        /* Update requirements: */
     
    316315{
    317316    /* Make sure guest OS type is set: */
    318     if (!m_guestOSType.isOk())
     317    if (m_strGuestOSTypeId.isEmpty())
    319318        return;
    320319
     
    323322
    324323    /* Get monitors count and recommended VRAM: */
    325     int iNeedMBytes = UICommon::requiredVideoMemory(m_guestOSType.getId(), m_cGuestScreenCount) / _1M;
     324    int iNeedMBytes = UICommon::requiredVideoMemory(m_strGuestOSTypeId, m_cGuestScreenCount) / _1M;
     325
    326326    /* Adjust visible maximum VRAM to be no less than 128MB (if possible): */
    327327    if (m_iMaxVRAMVisible < 128 && m_iMaxVRAM >= 128)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.h

    r101263 r101264  
    3434/* GUI includes: */
    3535#include "UIEditor.h"
    36 #include "UIGuestOSTypeII.h"
    3736
    3837/* COM includes: */
     
    6665
    6766    /** Defines @a comGuestOSType. */
    68     void setGuestOSType(const UIGuestOSTypeII &comGuestOSType);
     67    void setGuestOSTypeId(const QString &strGuestOSTypeId);
    6968
    7069    /** Defines @a cGuestScreenCount. */
     
    117116    /** @name Options
    118117     * @{ */
    119         /** Holds the guest OS type ID. */
    120         UIGuestOSTypeII          m_guestOSType;
     118        /** Holds the guest OS type Id. */
     119        QString                 m_strGuestOSTypeId;
    121120        /** Holds the guest screen count. */
    122121        int                      m_cGuestScreenCount;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r101263 r101264  
    330330    /* Remember new guest OS type: */
    331331    m_guestOSType = guestOSType;
    332     m_pEditorVideoMemorySize->setGuestOSType(m_guestOSType);
     332    m_pEditorVideoMemorySize->setGuestOSTypeId(m_guestOSType.getId());
    333333
    334334#ifdef VBOX_WITH_3D_ACCELERATION
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