VirtualBox

Ignore:
Timestamp:
Nov 3, 2009 4:13:57 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
54287
Message:

FE/Qt4: VBoxMedium cumulative patch: fixed tool-tip regression (for complex tool-tips) caused by Qt bugs related to html <nobr> tag ignoring; Possible fixed crash while copying CMedium object wrapped in VBoxMedium extension.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxMedium.h

    r23585 r24294  
    3232
    3333/**
     34 * Cache used to override some attributes in the user-friendly "don't show diffs" mode.
     35 */
     36struct NoDiffsCache
     37{
     38    NoDiffsCache() : isSet (false), state (KMediumState_NotCreated) {}
     39    NoDiffsCache& operator= (const NoDiffsCache &aOther)
     40    {
     41        isSet = aOther.isSet;
     42        state = aOther.state;
     43        result = aOther.result;
     44        toolTip = aOther.toolTip;
     45        return *this;
     46    }
     47
     48    bool isSet : 1;
     49
     50    KMediumState state;
     51    COMResult result;
     52    QString toolTip;
     53};
     54
     55/**
    3456 * Media descriptor for the GUI.
    3557 *
     
    100122        , mParent (0) { refresh(); }
    101123
     124    VBoxMedium& operator= (const VBoxMedium &aOther);
     125
    102126    void blockAndQueryState();
    103127    void refresh();
     
    138162    QString name (bool aNoDiffs = false) const { return aNoDiffs ? root().mName : mName; }
    139163    QString location (bool aNoDiffs = false) const { return aNoDiffs ? root().mLocation : mLocation; }
     164
    140165    QString size (bool aNoDiffs = false) const { return aNoDiffs ? root().mSize : mSize; }
    141166    QString logicalSize (bool aNoDiffs = false) const { return aNoDiffs ? root().mLogicalSize : mLogicalSize; }
     167
    142168    QString hardDiskFormat (bool aNoDiffs = false) const { return aNoDiffs ? root().mHardDiskFormat : mHardDiskFormat; }
    143169    QString hardDiskType (bool aNoDiffs = false) const { return aNoDiffs ? root().mHardDiskType : mHardDiskType; }
     170
    144171    QString usage (bool aNoDiffs = false) const { return aNoDiffs ? root().mUsage : mUsage; }
     172    QString tip() const { return mToolTip; }
     173
     174    const NoDiffsCache& cache() const { return mNoDiffs; }
    145175
    146176    /**
     
    182212     * Returns a parent medium. For non-hard disk media, this is always NULL.
    183213     */
    184     VBoxMedium *parent() const { return mParent; }
    185 
    186     VBoxMedium &root() const;
     214    VBoxMedium* parent() const { return mParent; }
     215
     216    VBoxMedium& root() const;
    187217
    188218    QString toolTip (bool aNoDiffs = false, bool aCheckRO = false, bool aNullAllowed = false) const;
     
    216246
    217247    QString mId;
     248    QString mName;
    218249    QString mLocation;
    219     QString mName;
     250
    220251    QString mSize;
     252    QString mLogicalSize;
    221253
    222254    QString mHardDiskFormat;
    223255    QString mHardDiskType;
    224     QString mLogicalSize;
    225256
    226257    QString mUsage;
     
    235266    VBoxMedium *mParent;
    236267
    237     /**
    238      * Used to override some attributes in the user-friendly "don't show diffs"
    239      * mode.
    240      */
    241     struct NoDiffs
    242     {
    243         NoDiffs() : isSet (false), state (KMediumState_NotCreated) {}
    244 
    245         bool isSet : 1;
    246 
    247         KMediumState state;
    248         COMResult result;
    249         QString toolTip;
    250     }
    251     mNoDiffs;
     268    NoDiffsCache mNoDiffs;
     269
     270    static QString mTable;
     271    static QString mRow;
    252272};
    253273
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