VirtualBox

Changeset 103870 in vbox


Ignore:
Timestamp:
Mar 15, 2024 3:53:33 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162241
Message:

FE/Qt: bugref:10384: UIGuestOSType: Cache whether OS type is supported; That allows to exclude unwanted types in OS type editor while still keeping them cached.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp

    r103868 r103870  
    8181void UIGuestOSTypeManager::addGuestOSType(const CGuestOSType &comType)
    8282{
     83    /* Acquire guest OS type ID and whether it's supported: */
     84    const QString strId = comType.GetId();
     85    const bool fSupported = m_supportedGuestOSTypeIDs.contains(strId);
     86
    8387    /* Append guest OS type to a list of cached wrappers: */
    84     m_guestOSTypes.append(UIGuestOSType(comType));
     88    m_guestOSTypes.append(UIGuestOSType(comType, fSupported));
    8589
    8690    /* Acquire a bit of attributes: */
    87     const QString strId = m_guestOSTypes.last().getId();
    8891    const QString strFamilyId = m_guestOSTypes.last().getFamilyId();
    8992    const QString strFamilyDesc = m_guestOSTypes.last().getFamilyDescription();
    9093    const QString strSubtype = m_guestOSTypes.last().getSubtype();
    9194    const KPlatformArchitecture enmArch = m_guestOSTypes.last().getPlatformArchitecture();
    92     const bool fSupported = m_supportedGuestOSTypeIDs.contains(strId);
    9395
    9496    /* Remember guest OS type index as well: */
     
    312314
    313315UIGuestOSType::UIGuestOSType()
    314 {
    315 }
    316 
    317 UIGuestOSType::UIGuestOSType(const CGuestOSType &comGuestOSType)
     316    : m_fSupported(false)
     317{
     318}
     319
     320UIGuestOSType::UIGuestOSType(const CGuestOSType &comGuestOSType, bool fSupported)
    318321    : m_comGuestOSType(comGuestOSType)
     322    , m_fSupported(fSupported)
    319323{
    320324}
     
    323327{
    324328    return (!m_comGuestOSType.isNull() && m_comGuestOSType.isOk());
     329}
     330
     331bool UIGuestOSType::isSupported() const
     332{
     333    return m_fSupported;
    325334}
    326335
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h

    r103803 r103870  
    121121public:
    122122
    123     UIGuestOSType(const CGuestOSType &comGuestOSType);
     123    UIGuestOSType(const CGuestOSType &comGuestOSType, bool fSupported);
    124124    UIGuestOSType();
     125
     126    bool isSupported() const;
    125127
    126128    const QString &getFamilyId() const;
     
    149151private:
    150152
     153    CGuestOSType m_comGuestOSType;
     154
     155    bool m_fSupported;
     156
    151157    /** @name CGuestOSType properties. Cached here for a faster access.
    152158      * @{ */
     
    157163        mutable QString m_strDescription;
    158164    /** @} */
    159 
    160     CGuestOSType m_comGuestOSType;
    161165};
    162166
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