VirtualBox

Changeset 42862 in vbox for trunk


Ignore:
Timestamp:
Aug 17, 2012 12:14:54 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
80132
Message:

FE/Qt: 6234: Support for VM groups: Release logging for chooser VMs loading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r42853 r42862  
    4545#include "CMachine.h"
    4646#include "CVirtualBox.h"
     47
     48/* Other VBox includes: */
     49#include <VBox/com/com.h>
     50#include <iprt/path.h>
    4751
    4852/* Type defs: */
     
    7882    /* Prepare handlers: */
    7983    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));
    80105}
    81106
     
    11951220{
    11961221    /* Add all the machines we have into the group-tree: */
     1222    LogRel(("Loading VMs started...\n"));
    11971223    foreach (const CMachine &machine, vboxGlobal().virtualBox().GetMachines())
    11981224        addMachineIntoTheTree(machine);
     1225    LogRel(("Loading VMs finished.\n"));
    11991226}
    12001227
    12011228void UIGChooserModel::addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible /* = false */)
    12021229{
    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()));
    12051235    /* Is that machine accessible? */
    12061236    if (machine.GetAccessible())
    12071237    {
     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()));
    12081247        foreach (QString strGroup, groups)
    12091248        {
     
    12121251                strGroup.truncate(strGroup.size() - 1);
    12131252            /* 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()));
    12141255            createMachineItem(machine, getGroupItem(strGroup, mainRoot(), fMakeItVisible));
    12151256        }
    12161257        /* Update group definitions: */
    1217         m_groups[machine.GetId()] = groups.toList();
     1258        m_groups[machine.GetId()] = groupList;
    12181259    }
    12191260    /* Inaccessible machine: */
    12201261    else
    12211262    {
     1263        /* VM is accessible: */
     1264        LogRel((" VM {%s} is inaccessible.\n", machine.GetId().toAscii().constData()));
    12221265        /* Create machine item with main-root group item as parent: */
    12231266        createMachineItem(machine, mainRoot());
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette