Changeset 53311 in vbox
- Timestamp:
- Nov 12, 2014 11:09:44 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 96890
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r53250 r53311 1637 1637 const int iPosition /* = -1 */) 1638 1638 { 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); 1641 1642 } 1642 1643 … … 1644 1645 const int iPosition /* = -1 */) 1645 1646 { 1646 /* Prepare arguments: */1647 QString strName;1648 QString strOsTypeID;1649 1647 /* Global ID? */ 1650 1648 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); 1673 1657 } 1674 1658
Note:
See TracChangeset
for help on using the changeset viewer.