VirtualBox

Changeset 67946 in vbox


Ignore:
Timestamp:
Jul 13, 2017 9:50:52 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8400: Caching medium variant in UIMedium.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp

    r67921 r67946  
    4242    , m_state(KMediumState_NotCreated)
    4343    , m_enmMediumType(KMediumType_Max)
     44    , m_enmMediumVariant(KMediumVariant_Max)
    4445{
    4546    refresh();
     
    5152    , m_state(KMediumState_NotCreated)
    5253    , m_enmMediumType(KMediumType_Max)
     54    , m_enmMediumVariant(KMediumVariant_Max)
    5355{
    5456    refresh();
     
    6062    , m_state(state)
    6163    , m_enmMediumType(KMediumType_Max)
     64    , m_enmMediumVariant(KMediumVariant_Max)
    6265{
    6366    refresh();
     
    9497
    9598    m_enmMediumType = other.mediumType();
     99    m_enmMediumVariant = other.mediumVariant();
    96100
    97101    m_strHardDiskType = other.hardDiskType();
     
    156160    m_uSize = m_uLogicalSize = 0;
    157161
    158     /* Reset medium type parameter: */
     162    /* Reset medium type & variant parameter: */
    159163    m_enmMediumType = KMediumType_Max;
     164    m_enmMediumVariant = KMediumVariant_Max;
    160165
    161166    /* Reset hard drive related parameters: */
     
    229234        }
    230235
    231         /* Refresh medium type: */
     236        /* Refresh medium type & variant: */
    232237        m_enmMediumType = m_medium.GetType();
     238        qlonglong iMediumVariant = 0;
     239        foreach (const KMediumVariant &enmVariant, m_medium.GetVariant())
     240            iMediumVariant |= enmVariant;
     241        m_enmMediumVariant = (KMediumVariant)iMediumVariant;
    233242
    234243        /* For hard drive medium: */
     
    241250
    242251            /* Refresh hard drive storage details: */
    243             qlonglong iMediumVariant = 0;
    244             foreach (const KMediumVariant &enmVariant, m_medium.GetVariant())
    245                 iMediumVariant |= enmVariant;
    246             m_strStorageDetails = gpConverter->toString((KMediumVariant)iMediumVariant);
     252            m_strStorageDetails = gpConverter->toString(m_enmMediumVariant);
    247253
    248254            /* Check whether this is read-only hard drive: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h

    r67921 r67946  
    199199      * @note  In "don't show diffs" mode, this method returns the disk type of root in the given hard drive chain. */
    200200    KMediumType mediumType(bool fNoDiffs = false) const { return fNoDiffs ? root().m_enmMediumType : m_enmMediumType; }
     201    /** Returns the medium disk variant.
     202      * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode.
     203      * @note  In "don't show diffs" mode, this method returns the disk variant of root in the given hard drive chain. */
     204    KMediumVariant mediumVariant(bool fNoDiffs = false) const { return fNoDiffs ? root().m_enmMediumVariant : m_enmMediumVariant; }
    201205
    202206    /** Returns the hard drive medium disk type.
     
    362366    /** Holds the medium disk type. */
    363367    KMediumType m_enmMediumType;
     368    /** Holds the medium disk variant. */
     369    KMediumVariant m_enmMediumVariant;
    364370
    365371    /** Holds the hard drive medium disk type. */
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