VirtualBox

Changeset 83161 in vbox


Ignore:
Timestamp:
Feb 26, 2020 2:37:40 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: UICloudMachine: Turn off auto-refresh temporary, it will be done more wise using manual approach; Besides that move simple getter implementations to class header.

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

Legend:

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

    r83160 r83161  
    3434    , m_strId(strId)
    3535    , m_strName(strName)
    36     , m_fDataActual(false)
    3736    , m_fAccessible(true)
    3837    , m_strOsType("Other")
     
    4847    , m_strId(other.m_strId)
    4948    , m_strName(other.m_strName)
    50     , m_fDataActual(other.m_fDataActual)
    5149    , m_fAccessible(other.m_fAccessible)
    5250    , m_strOsType(other.m_strOsType)
     
    6260}
    6361
    64 CCloudClient UICloudMachineData::cloudClient() const
    65 {
    66     return m_comCloudClient;
    67 }
    68 
    69 QString UICloudMachineData::id() const
    70 {
    71     return m_strId;
    72 }
    73 
    74 QString UICloudMachineData::name() const
    75 {
    76     return m_strName;
    77 }
    78 
    79 bool UICloudMachineData::isAccessible() const
    80 {
    81     return m_fAccessible;
    82 }
    83 
    84 QString UICloudMachineData::osType()
    85 {
    86     if (!m_fDataActual)
    87         refresh();
    88     return m_strOsType;
    89 }
    90 
    91 int UICloudMachineData::memorySize()
    92 {
    93     if (!m_fDataActual)
    94         refresh();
    95     return m_iMemorySize;
    96 }
    97 
    98 int UICloudMachineData::cpuCount()
    99 {
    100     if (!m_fDataActual)
    101         refresh();
    102     return m_iCpuCount;
    103 }
    104 
    10562void UICloudMachineData::refresh()
    10663{
     
    11269    m_iMemorySize = fetchMemorySize(infoMap);
    11370    m_iCpuCount = fetchCpuCount(infoMap);
    114 
    115     /* Mark data actual: */
    116     m_fDataActual = true;
    11771}
    11872
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.h

    r83160 r83161  
    5050    virtual ~UICloudMachineData();
    5151
     52    /** Performs data refreshing. */
     53    void refresh();
     54
    5255    /** Returns cloud client object reference. */
    53     CCloudClient cloudClient() const;
     56    CCloudClient cloudClient() const { return m_comCloudClient; }
    5457
    5558    /** Returns cloud VM id. */
    56     QString id() const;
     59    QString id() const { return m_strId; }
    5760    /** Returns cloud VM name. */
    58     QString name() const;
     61    QString name() const { return m_strName; }
    5962
    6063    /** Returns whether cloud VM is accessible. */
    61     bool isAccessible() const;
     64    bool isAccessible() const { return m_fAccessible; }
    6265
    6366    /** Returns cloud VM OS type. */
    64     QString osType();
     67    QString osType() const { return m_strOsType; }
    6568    /** Returns cloud VM memory size. */
    66     int memorySize();
     69    int memorySize() const { return m_iMemorySize; }
    6770    /** Returns cloud VM CPU count. */
    68     int cpuCount();
     71    int cpuCount() const { return m_iCpuCount; }
    6972
    7073private:
    71 
    72     /** Performs data refreshing. */
    73     void refresh();
    7474
    7575    /** Holds the cloud client object reference. */
     
    8080    /** Holds the cloud VM name. */
    8181    const QString  m_strName;
    82 
    83     /** Holds whether data is actual. */
    84     bool  m_fDataActual;
    8582
    8683    /** Holds whether cloud VM is accessible. */
     
    115112    UICloudMachine(const UICloudMachine &other);
    116113
     114    /** Performs data refreshing. */
     115    void refresh() { d->refresh(); }
     116
    117117    /** Returns whether cloud VM wrapper is null. */
    118118    bool isNull() const { return !d.constData(); }
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