Changeset 51048 in vbox
- Timestamp:
- Apr 11, 2014 11:30:11 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extradata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r51047 r51048 29 29 #include "COMEnums.h" 30 30 #include "CEventSource.h" 31 #include "CVirtualBox.h" 32 #include "CMachine.h" 31 33 32 34 … … 213 215 /* Prepare extra-data event-handler: */ 214 216 prepareExtraDataEventHandler(); 217 /* Prepare extra-data map: */ 218 prepareExtraDataMap(); 215 219 } 216 220 … … 273 277 } 274 278 279 void UIExtraDataManager::prepareExtraDataMap() 280 { 281 /* Get CVirtualBox: */ 282 CVirtualBox vbox = vboxGlobal().virtualBox(); 283 /* Load extra-data map: */ 284 if (!vboxGlobal().isVMConsoleProcess()) 285 { 286 /* From CVirtualBox for Selector UI: */ 287 foreach (const QString &strKey, vbox.GetExtraDataKeys()) 288 m_data[strKey] = vbox.GetExtraData(strKey); 289 } 290 else 291 { 292 /* From CMachine for Runtime UI: */ 293 const QString strMachineID = vboxGlobal().managedVMUuid(); 294 CMachine machine = vbox.FindMachine(strMachineID); 295 AssertMsgReturnVoid(vbox.isOk() && !machine.isNull(), 296 ("Machine with ID={%s} was not found!\n", 297 strMachineID.toAscii().constData())); 298 foreach (const QString &strKey, machine.GetExtraDataKeys()) 299 m_data[strKey] = machine.GetExtraData(strKey); 300 } 301 } 302 275 303 void UIExtraDataManager::cleanup() 276 304 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51047 r51048 20 20 /* Qt includes: */ 21 21 #include <QObject> 22 #include <QMap> 22 23 23 24 /* COM includes: */ … … 74 75 /** Prepare extra-data event-handler. */ 75 76 void prepareExtraDataEventHandler(); 77 /** Prepare extra-data map. */ 78 void prepareExtraDataMap(); 76 79 77 80 /** Cleanup Extra-data Manager. */ … … 80 83 void cleanupMainEventListener(); 81 84 // /** Cleanup extra-data event-handler. */ 82 // void cleanupExtraDataEventHandler() {} 85 // void cleanupExtraDataEventHandler(); 86 // /** Cleanup extra-data map. */ 87 // void cleanupExtraDataMap(); 83 88 84 89 /** Singleton Extra-data Manager instance. */ … … 89 94 /** Extra-data event-handler instance. */ 90 95 UIExtraDataEventHandler *m_pHandler; 96 97 /** Extra-data map. */ 98 QMap<QString, QString> m_data; 91 99 }; 92 100
Note:
See TracChangeset
for help on using the changeset viewer.