VirtualBox

Changeset 53311 in vbox


Ignore:
Timestamp:
Nov 12, 2014 11:09:44 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96890
Message:

FE/Qt: Extra-data Manager: Filter out inaccessible VMs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r53250 r53311  
    16371637                                                       const int iPosition /* = -1 */)
    16381638{
    1639     /* Call to wrapper above: */
    1640     addChooserItem(machine.GetId(), machine.GetName(), machine.GetOSTypeId(), iPosition);
     1639    /* Make sure VM is accessible: */
     1640    if (!machine.isNull() && machine.GetAccessible())
     1641        return addChooserItem(machine.GetId(), machine.GetName(), machine.GetOSTypeId(), iPosition);
    16411642}
    16421643
     
    16441645                                                  const int iPosition /* = -1 */)
    16451646{
    1646     /* Prepare arguments: */
    1647     QString strName;
    1648     QString strOsTypeID;
    16491647    /* Global ID? */
    16501648    if (strID == UIExtraDataManager::GlobalID)
    1651         strName = "Global";
    1652     /* Machine ID? */
    1653     else
    1654     {
    1655         /* Search for the corresponding machine by ID: */
    1656         CVirtualBox vbox = vboxGlobal().virtualBox();
    1657         const CMachine machine = vbox.FindMachine(strID);
    1658         /* Acquire actual arguments if possible: */
    1659         if (vbox.isOk() && !machine.isNull())
    1660         {
    1661             strName = machine.GetName();
    1662             strOsTypeID = machine.GetOSTypeId();
    1663         }
    1664         /* Or use default: */
    1665         else
    1666         {
    1667             strName = "Unknown VM";
    1668             strOsTypeID = "Other";
    1669         }
    1670     }
    1671     /* Call to wrapper above: */
    1672     addChooserItem(strID, strName, strOsTypeID, iPosition);
     1649        return addChooserItem(strID, QString("Global"), QString(), iPosition);
     1650
     1651    /* Search for the corresponding machine by ID: */
     1652    CVirtualBox vbox = vboxGlobal().virtualBox();
     1653    const CMachine machine = vbox.FindMachine(strID);
     1654    /* Make sure VM is accessible: */
     1655    if (vbox.isOk() && !machine.isNull() && machine.GetAccessible())
     1656        return addChooserItem(strID, machine.GetName(), machine.GetOSTypeId(), iPosition);
    16731657}
    16741658
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