Changeset 83923 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 22, 2020 12:22:03 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r83921 r83923 520 520 AssertPtrReturnVoid(pFirstChildNodeMachine); 521 521 AssertPtrReturnVoid(pFirstChildNodeMachine->cache()); 522 AssertReturnVoid(pFirstChildNodeMachine->cache ()->itemType() == UIVirtualMachineItemType_CloudFake);522 AssertReturnVoid(pFirstChildNodeMachine->cacheType() == UIVirtualMachineItemType_CloudFake); 523 523 524 524 /* And if we have at least one cloud machine: */ … … 979 979 foreach (UIChooserNode *pNode, pParentGroup->nodes(UIChooserNodeType_Machine)) 980 980 if (UIChooserNodeMachine *pMachineNode = pNode->toMachineNode()) 981 if ( pMachineNode->cache ()->itemType() == UIVirtualMachineItemType_Local981 if ( pMachineNode->cacheType() == UIVirtualMachineItemType_Local 982 982 && pMachineNode->cache()->accessible()) 983 983 definitions[toOldStyleUuid(pMachineNode->cache()->id())] << pParentGroup->fullName(); … … 1008 1008 foreach (UIChooserNode *pNode, pParentGroup->nodes(UIChooserNodeType_Machine)) 1009 1009 if (UIChooserNodeMachine *pMachineNode = pNode->toMachineNode()) 1010 if ( pMachineNode->cache ()->itemType() == UIVirtualMachineItemType_Local1011 || pMachineNode->cache ()->itemType() == UIVirtualMachineItemType_CloudReal)1010 if ( pMachineNode->cacheType() == UIVirtualMachineItemType_Local 1011 || pMachineNode->cacheType() == UIVirtualMachineItemType_CloudReal) 1012 1012 orders[strExtraDataKey] << QString("m=%1").arg(toOldStyleUuid(pMachineNode->cache()->id())); 1013 1013 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r83921 r83923 726 726 /* For local items: */ 727 727 if ( node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Local 728 && pMachineItem->node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_Local)728 && pMachineItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local) 729 729 { 730 730 /* Make sure passed machine isn't immutable within own group: */ … … 751 751 else 752 752 if ( node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Profile 753 && pMachineItem->node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_CloudReal)753 && pMachineItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_CloudReal) 754 754 { 755 755 /* Make sure passed item is ours: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r83921 r83923 297 297 /* And machine-item content to take into account: */ 298 298 int iTopLineWidth = m_iMinimumNameWidth; 299 if ( node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_Local299 if ( node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local 300 300 && !node()->toMachineNode()->cache()->toLocal()->snapshotName().isEmpty()) 301 301 iTopLineWidth += (iMinorSpacing + … … 395 395 396 396 /* No drops for cloud items: */ 397 if ( node()->toMachineNode()->cache ()->itemType() != UIVirtualMachineItemType_Local398 || pMachineItem->node()->toMachineNode()->cache ()->itemType() != UIVirtualMachineItemType_Local)397 if ( node()->toMachineNode()->cacheType() != UIVirtualMachineItemType_Local 398 || pMachineItem->node()->toMachineNode()->cacheType() != UIVirtualMachineItemType_Local) 399 399 return false; 400 400 /* No drops for immutable item: */ … … 721 721 int iMinimumSnapshotNameWidth = 0; 722 722 /* Is there any snapshot exists? */ 723 if ( node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_Local723 if ( node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local 724 724 && !node()->toMachineNode()->cache()->toLocal()->snapshotName().isEmpty()) 725 725 { … … 807 807 { 808 808 /* Make sure this is local machine item: */ 809 if (node()->toMachineNode()->cache ()->itemType() != UIVirtualMachineItemType_Local)809 if (node()->toMachineNode()->cacheType() != UIVirtualMachineItemType_Local) 810 810 return; 811 811 … … 1113 1113 1114 1114 /* Paint middle element: */ 1115 if ( node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_Local1115 if ( node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local 1116 1116 && !node()->toMachineNode()->cache()->toLocal()->snapshotName().isEmpty()) 1117 1117 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r83921 r83923 1056 1056 foreach (UIChooserItemMachine *pItem, inaccessibleMachineItemList) 1057 1057 { 1058 switch (pItem->node()->toMachineNode()->cache ()->itemType())1058 switch (pItem->node()->toMachineNode()->cacheType()) 1059 1059 { 1060 1060 case UIVirtualMachineItemType_Local: … … 1150 1150 if (fVerdict) 1151 1151 { 1152 if (pItem->node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_Local)1152 if (pItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local) 1153 1153 localMachinesToUnregister.append(pItem->node()->toMachineNode()->cache()->toLocal()->machine()); 1154 else if (pItem->node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_CloudReal)1154 else if (pItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_CloudReal) 1155 1155 cloudMachinesToUnregister.append(pItem->node()->toMachineNode()->cache()->toCloud()->machine()); 1156 1156 } … … 1739 1739 UIChooserItemSearchFlag_ExactId); 1740 1740 AssertPtrReturnVoid(pItem); 1741 AssertReturnVoid(pItem->node()->toMachineNode()->cache ()->itemType() == UIVirtualMachineItemType_CloudReal);1741 AssertReturnVoid(pItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_CloudReal); 1742 1742 AssertPtrReturnVoid(pItem->parentItem()); 1743 1743 AssertPtrReturnVoid(pItem->parentItem()->parentItem()); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
r83921 r83923 79 79 { 80 80 /* Prepare cache of corresponding type: */ 81 switch (pCopyFrom->cache ()->itemType())81 switch (pCopyFrom->cacheType()) 82 82 { 83 83 case UIVirtualMachineItemType_Local: … … 234 234 } 235 235 236 UIVirtualMachineItem *UIChooserNodeMachine::cache() const 237 { 238 return m_pCache; 239 } 240 241 UIVirtualMachineItemType UIChooserNodeMachine::cacheType() const 242 { 243 return cache() ? cache()->itemType() : UIVirtualMachineItemType_Local; 244 } 245 236 246 void UIChooserNodeMachine::retranslateUi() 237 247 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h
r83884 r83923 24 24 /* GUI includes: */ 25 25 #include "UIChooserNode.h" 26 #include "UIManagerDefs.h" 26 27 27 28 /* Forward declarations: */ … … 106 107 107 108 /** Returns virtual machine cache instance. */ 108 UIVirtualMachineItem *cache() const { return m_pCache; } 109 UIVirtualMachineItem *cache() const; 110 /** Returns virtual machine cache instance. */ 111 UIVirtualMachineItemType cacheType() const; 109 112 110 113 protected:
Note:
See TracChangeset
for help on using the changeset viewer.