- Timestamp:
- Aug 17, 2012 12:14:54 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80132
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r42853 r42862 45 45 #include "CMachine.h" 46 46 #include "CVirtualBox.h" 47 48 /* Other VBox includes: */ 49 #include <VBox/com/com.h> 50 #include <iprt/path.h> 47 51 48 52 /* Type defs: */ … … 78 82 /* Prepare handlers: */ 79 83 prepareHandlers(); 84 85 /* Prepare release logging: */ 86 char szLogFile[RTPATH_MAX]; 87 const char *pszLogFile = NULL; 88 com::GetVBoxUserHomeDirectory(szLogFile, sizeof(szLogFile)); 89 RTPathAppend(szLogFile, sizeof(szLogFile), "selectorwindow.log"); 90 pszLogFile = szLogFile; 91 /* Create release logger, to file: */ 92 char szError[RTPATH_MAX + 128]; 93 com::VBoxLogRelCreate("GUI VM Selector Window", 94 pszLogFile, 95 RTLOGFLAGS_PREFIX_TIME_PROG, 96 "all", 97 "VBOX_GUI_SELECTORWINDOW_RELEASE_LOG", 98 RTLOGDEST_FILE, 99 UINT32_MAX, 100 1, 101 60 * 60, 102 _1M, 103 szError, 104 sizeof(szError)); 80 105 } 81 106 … … 1195 1220 { 1196 1221 /* Add all the machines we have into the group-tree: */ 1222 LogRel(("Loading VMs started...\n")); 1197 1223 foreach (const CMachine &machine, vboxGlobal().virtualBox().GetMachines()) 1198 1224 addMachineIntoTheTree(machine); 1225 LogRel(("Loading VMs finished.\n")); 1199 1226 } 1200 1227 1201 1228 void UIGChooserModel::addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible /* = false */) 1202 1229 { 1203 /* Which groups passed machine attached to? */ 1204 QVector<QString> groups = machine.GetGroups(); 1230 /* Which VM we are loading: */ 1231 if (machine.isNull()) 1232 LogRel((" ERROR: VM is NULL!\n")); 1233 else 1234 LogRel((" Loading VM {%s}...\n", machine.GetId().toAscii().constData())); 1205 1235 /* Is that machine accessible? */ 1206 1236 if (machine.GetAccessible()) 1207 1237 { 1238 /* VM is accessible: */ 1239 QString strName = machine.GetName(); 1240 LogRel((" VM {%s} is accessible.\n", strName.toAscii().constData())); 1241 /* Which groups passed machine attached to? */ 1242 QVector<QString> groups = machine.GetGroups(); 1243 QStringList groupList = groups.toList(); 1244 QString strGroups = groupList.join(", "); 1245 LogRel((" VM {%s} groups are {%s}.\n", strName.toAscii().constData(), 1246 strGroups.toAscii().constData())); 1208 1247 foreach (QString strGroup, groups) 1209 1248 { … … 1212 1251 strGroup.truncate(strGroup.size() - 1); 1213 1252 /* Create machine item with found group item as parent: */ 1253 LogRel((" Creating item for VM {%s}, group {%s}.\n", strName.toAscii().constData(), 1254 strGroup.toAscii().constData())); 1214 1255 createMachineItem(machine, getGroupItem(strGroup, mainRoot(), fMakeItVisible)); 1215 1256 } 1216 1257 /* Update group definitions: */ 1217 m_groups[machine.GetId()] = group s.toList();1258 m_groups[machine.GetId()] = groupList; 1218 1259 } 1219 1260 /* Inaccessible machine: */ 1220 1261 else 1221 1262 { 1263 /* VM is accessible: */ 1264 LogRel((" VM {%s} is inaccessible.\n", machine.GetId().toAscii().constData())); 1222 1265 /* Create machine item with main-root group item as parent: */ 1223 1266 createMachineItem(machine, mainRoot());
Note:
See TracChangeset
for help on using the changeset viewer.