VirtualBox

Changeset 67966 in vbox


Ignore:
Timestamp:
Jul 14, 2017 1:01:57 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116968
Message:

FE/Qt: bugref:8400: Caching medium description 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

    r67946 r67966  
    9090    m_strName = other.name();
    9191    m_strLocation = other.location();
     92    m_strDescription = other.description();
    9293
    9394    m_uSize = other.sizeInBytes();
     
    155156    //m_strKey = nullID();
    156157
    157     /* Reset name/location/size parameters: */
     158    /* Reset name/location/description/size parameters: */
    158159    m_strName = VBoxGlobal::tr("Empty", "medium");
    159160    m_strLocation = m_strSize = m_strLogicalSize = QString("--");
     161    m_strDescription = QString();
    160162    m_uSize = m_uLogicalSize = 0;
    161163
     
    209211        else
    210212            m_strName = VBoxGlobal::tr("Host Drive %1 (%2)", "medium").arg(m_medium.GetDescription(), m_medium.GetName());
    211         /* Refresh medium location: */
     213        /* Refresh medium location/description: */
    212214        if (!m_fHostDrive)
     215        {
    213216            m_strLocation = QDir::toNativeSeparators(m_medium.GetLocation());
     217            m_strDescription = m_medium.GetDescription();
     218        }
    214219
    215220        /* Refresh medium size and logical size: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.h

    r67946 r67966  
    177177      * @note  In "don't show diffs" mode, this method returns the location of root in the given hard drive chain. */
    178178    QString location(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strLocation : m_strLocation; }
     179    /** Returns the medium description.
     180      * @param fNoDiffs @c true to enable user-friendly "don't show diffs" mode.
     181      * @note  In "don't show diffs" mode, this method returns the description of root in the given hard drive chain. */
     182    QString description(bool fNoDiffs = false) const { return fNoDiffs ? root().m_strDescription : m_strDescription; }
    179183
    180184    /** Returns the medium size in bytes.
     
    354358    /** Holds the medium location. */
    355359    QString m_strLocation;
     360    /** Holds the medium description. */
     361    QString m_strDescription;
    356362
    357363    /** Holds the medium size in bytes. */
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