Changeset 83161 in vbox
- Timestamp:
- Feb 26, 2020 2:37:40 PM (5 years ago)
- 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 34 34 , m_strId(strId) 35 35 , m_strName(strName) 36 , m_fDataActual(false)37 36 , m_fAccessible(true) 38 37 , m_strOsType("Other") … … 48 47 , m_strId(other.m_strId) 49 48 , m_strName(other.m_strName) 50 , m_fDataActual(other.m_fDataActual)51 49 , m_fAccessible(other.m_fAccessible) 52 50 , m_strOsType(other.m_strOsType) … … 62 60 } 63 61 64 CCloudClient UICloudMachineData::cloudClient() const65 {66 return m_comCloudClient;67 }68 69 QString UICloudMachineData::id() const70 {71 return m_strId;72 }73 74 QString UICloudMachineData::name() const75 {76 return m_strName;77 }78 79 bool UICloudMachineData::isAccessible() const80 {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 105 62 void UICloudMachineData::refresh() 106 63 { … … 112 69 m_iMemorySize = fetchMemorySize(infoMap); 113 70 m_iCpuCount = fetchCpuCount(infoMap); 114 115 /* Mark data actual: */116 m_fDataActual = true;117 71 } 118 72 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.h
r83160 r83161 50 50 virtual ~UICloudMachineData(); 51 51 52 /** Performs data refreshing. */ 53 void refresh(); 54 52 55 /** Returns cloud client object reference. */ 53 CCloudClient cloudClient() const ;56 CCloudClient cloudClient() const { return m_comCloudClient; } 54 57 55 58 /** Returns cloud VM id. */ 56 QString id() const ;59 QString id() const { return m_strId; } 57 60 /** Returns cloud VM name. */ 58 QString name() const ;61 QString name() const { return m_strName; } 59 62 60 63 /** Returns whether cloud VM is accessible. */ 61 bool isAccessible() const ;64 bool isAccessible() const { return m_fAccessible; } 62 65 63 66 /** Returns cloud VM OS type. */ 64 QString osType() ;67 QString osType() const { return m_strOsType; } 65 68 /** Returns cloud VM memory size. */ 66 int memorySize() ;69 int memorySize() const { return m_iMemorySize; } 67 70 /** Returns cloud VM CPU count. */ 68 int cpuCount() ;71 int cpuCount() const { return m_iCpuCount; } 69 72 70 73 private: 71 72 /** Performs data refreshing. */73 void refresh();74 74 75 75 /** Holds the cloud client object reference. */ … … 80 80 /** Holds the cloud VM name. */ 81 81 const QString m_strName; 82 83 /** Holds whether data is actual. */84 bool m_fDataActual;85 82 86 83 /** Holds whether cloud VM is accessible. */ … … 115 112 UICloudMachine(const UICloudMachine &other); 116 113 114 /** Performs data refreshing. */ 115 void refresh() { d->refresh(); } 116 117 117 /** Returns whether cloud VM wrapper is null. */ 118 118 bool isNull() const { return !d.constData(); }
Note:
See TracChangeset
for help on using the changeset viewer.