- Timestamp:
- Oct 28, 2020 4:08:53 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r86739 r86740 1715 1715 } 1716 1716 1717 UIChooserNode *UIChooserAbstractModel::searchProfileNode(const QString &strProviderShortName, const QString &strProfileName) 1718 { 1719 /* Compose profile node ID: */ 1720 const QString strProfileNodeId = QString("/%1/%2").arg(strProviderShortName, strProfileName); 1721 1722 /* Search for a list of nodes matching required ID: */ 1717 UIChooserNode *UIChooserAbstractModel::searchProviderNode(const QString &strProviderShortName) 1718 { 1719 /* Search for a list of nodes matching passed name: */ 1720 QList<UIChooserNode*> providerNodes; 1721 invisibleRoot()->searchForNodes(strProviderShortName, 1722 UIChooserItemSearchFlag_CloudProvider | UIChooserItemSearchFlag_ExactName, 1723 providerNodes); 1724 1725 /* Return 1st node if any: */ 1726 return providerNodes.value(0); 1727 } 1728 1729 UIChooserNode *UIChooserAbstractModel::searchProfileNode(UIChooserNode *pProviderNode, const QString &strProfileName) 1730 { 1731 AssertPtrReturn(pProviderNode, 0); 1732 1733 /* Search for a list of nodes matching passed name: */ 1723 1734 QList<UIChooserNode*> profileNodes; 1724 invisibleRoot()->searchForNodes(strProfileNodeId, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes); 1735 pProviderNode->searchForNodes(strProfileName, 1736 UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactName, 1737 profileNodes); 1725 1738 1726 1739 /* Return 1st node if any: */ … … 1728 1741 } 1729 1742 1743 UIChooserNode *UIChooserAbstractModel::searchProfileNode(const QString &strProviderShortName, const QString &strProfileName) 1744 { 1745 /* Wrap method above: */ 1746 return searchProfileNode(searchProviderNode(strProviderShortName), strProfileName); 1747 } 1748 1749 UIChooserNode *UIChooserAbstractModel::searchMachineNode(UIChooserNode *pProfileNode, const QUuid &uMachineId) 1750 { 1751 AssertPtrReturn(pProfileNode, 0); 1752 1753 /* Search for a list of nodes matching passed ID: */ 1754 QList<UIChooserNode*> machineNodes; 1755 pProfileNode->searchForNodes(uMachineId.toString(), 1756 UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, 1757 machineNodes); 1758 1759 /* Return 1st node if any: */ 1760 return machineNodes.value(0); 1761 } 1762 1763 UIChooserNode *UIChooserAbstractModel::searchMachineNode(const QString &strProviderShortName, const QString &strProfileName, const QUuid &uMachineId) 1764 { 1765 /* Wrap method above: */ 1766 return searchMachineNode(searchProfileNode(strProviderShortName, strProfileName), uMachineId); 1767 } 1768 1730 1769 UIChooserNode *UIChooserAbstractModel::searchFakeNode(UIChooserNode *pProfileNode) 1731 1770 { 1732 /* Search for a list of nodes matching null ID: */ 1733 QList<UIChooserNode*> fakeNodes; 1734 pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes); 1735 1736 /* Return 1st node if any: */ 1737 return fakeNodes.value(0); 1771 /* Wrap method above: */ 1772 return searchMachineNode(pProfileNode, QUuid()); 1773 } 1774 1775 UIChooserNode *UIChooserAbstractModel::searchFakeNode(const QString &strProviderShortName, const QString &strProfileName) 1776 { 1777 /* Wrap method above: */ 1778 return searchMachineNode(strProviderShortName, strProfileName, QUuid()); 1738 1779 } 1739 1780 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r86739 r86740 345 345 /** @name Cloud stuff. 346 346 * @{ */ 347 /** Searches for provider node with passed @a strProviderShortName. */ 348 UIChooserNode *searchProviderNode(const QString &strProviderShortName); 349 350 /** Searches for profile node with passed @a strProfileName under passed @a pProviderNode. */ 351 UIChooserNode *searchProfileNode(UIChooserNode *pProviderNode, const QString &strProfileName); 347 352 /** Searches for profile node with passed @a strProviderShortName and @a strProfileName. */ 348 353 UIChooserNode *searchProfileNode(const QString &strProviderShortName, const QString &strProfileName); 354 355 /** Searches for machine node with passed @a uMachineId under passed @a pProfileNode. */ 356 UIChooserNode *searchMachineNode(UIChooserNode *pProfileNode, const QUuid &uMachineId); 357 /** Searches for machine with passed @a strProviderShortName, @a strProfileName and @a uMachineId. */ 358 UIChooserNode *searchMachineNode(const QString &strProviderShortName, const QString &strProfileName, const QUuid &uMachineId); 359 349 360 /** Searches for fake node under passed @a pProfileNode. */ 350 361 UIChooserNode *searchFakeNode(UIChooserNode *pProfileNode); 362 /** Searches for fake with passed @a strProviderShortName and @a strProfileName. */ 363 UIChooserNode *searchFakeNode(const QString &strProviderShortName, const QString &strProfileName); 351 364 /** @} */ 352 365
Note:
See TracChangeset
for help on using the changeset viewer.