Changeset 83160 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 26, 2020 12:40:06 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136281
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.cpp
r83159 r83160 16 16 */ 17 17 18 /* Qt includes: */ 19 #include <QMap> 20 18 21 /* GUI includes: */ 19 22 #include "UICloudMachine.h" 23 #include "UICloudNetworkingStuff.h" 20 24 21 25 … … 30 34 , m_strId(strId) 31 35 , m_strName(strName) 36 , m_fDataActual(false) 32 37 , m_fAccessible(true) 33 38 , m_strOsType("Other") … … 43 48 , m_strId(other.m_strId) 44 49 , m_strName(other.m_strName) 50 , m_fDataActual(other.m_fDataActual) 45 51 , m_fAccessible(other.m_fAccessible) 46 52 , m_strOsType(other.m_strOsType) … … 78 84 QString UICloudMachineData::osType() 79 85 { 86 if (!m_fDataActual) 87 refresh(); 80 88 return m_strOsType; 81 89 } … … 83 91 int UICloudMachineData::memorySize() 84 92 { 93 if (!m_fDataActual) 94 refresh(); 85 95 return m_iMemorySize; 86 96 } … … 88 98 int UICloudMachineData::cpuCount() 89 99 { 100 if (!m_fDataActual) 101 refresh(); 90 102 return m_iCpuCount; 103 } 104 105 void UICloudMachineData::refresh() 106 { 107 /* Acquire instance info sync way, be aware, this is blocking stuff, it takes some time: */ 108 const QMap<KVirtualSystemDescriptionType, QString> infoMap = getInstanceInfo(m_comCloudClient, m_strId); 109 110 /* Refresh corresponding values: */ 111 m_strOsType = fetchOsType(infoMap); 112 m_iMemorySize = fetchMemorySize(infoMap); 113 m_iCpuCount = fetchCpuCount(infoMap); 114 115 /* Mark data actual: */ 116 m_fDataActual = true; 91 117 } 92 118 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.h
r83159 r83160 70 70 private: 71 71 72 /** Performs data refreshing. */ 73 void refresh(); 74 72 75 /** Holds the cloud client object reference. */ 73 76 CCloudClient m_comCloudClient; … … 77 80 /** Holds the cloud VM name. */ 78 81 const QString m_strName; 82 83 /** Holds whether data is actual. */ 84 bool m_fDataActual; 79 85 80 86 /** Holds whether cloud VM is accessible. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r83158 r83160 196 196 } 197 197 198 int UICloudNetworkingStuff::fetchMemorySize(const QMap<KVirtualSystemDescriptionType, QString> &infoMap) 199 { 200 /* Return memory size value: */ 201 return infoMap.value(KVirtualSystemDescriptionType_Memory).toInt(); 202 } 203 204 int UICloudNetworkingStuff::fetchCpuCount(const QMap<KVirtualSystemDescriptionType, QString> &infoMap) 205 { 206 /* Return CPU count value: */ 207 return infoMap.value(KVirtualSystemDescriptionType_CPU).toInt(); 208 } 209 198 210 KMachineState UICloudNetworkingStuff::fetchMachineState(const QMap<KVirtualSystemDescriptionType, QString> &infoMap) 199 211 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r83158 r83160 60 60 /** Fetches cloud VM OS type from the passed @a info. */ 61 61 SHARED_LIBRARY_STUFF QString fetchOsType(const QMap<KVirtualSystemDescriptionType, QString> &infoMap); 62 /** Fetches cloud VM memory size from the passed @a info. */ 63 SHARED_LIBRARY_STUFF int fetchMemorySize(const QMap<KVirtualSystemDescriptionType, QString> &infoMap); 64 /** Fetches cloud VM CPU count from the passed @a info. */ 65 SHARED_LIBRARY_STUFF int fetchCpuCount(const QMap<KVirtualSystemDescriptionType, QString> &infoMap); 62 66 /** Fetches cloud VM state from the passed @a info. */ 63 67 SHARED_LIBRARY_STUFF KMachineState fetchMachineState(const QMap<KVirtualSystemDescriptionType, QString> &infoMap);
Note:
See TracChangeset
for help on using the changeset viewer.