- Timestamp:
- May 20, 2020 1:44:57 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
r84378 r84400 650 650 AssertMsg(!strFirstSuffix.isEmpty(), ("Invalid group name!")); 651 651 /* Trying to get group node among our children: */ 652 foreach (UIChooserNode *p GroupNode, pParentNode->nodes(UIChooserNodeType_Group))652 foreach (UIChooserNode *pNode, pParentNode->nodes(UIChooserNodeType_Group)) 653 653 { 654 if ( pGroupNode->toGroupNode()->groupType() == UIChooserNodeGroupType_Local 655 && pGroupNode->name() == strSecondSubName) 654 AssertPtrReturn(pNode, 0); 655 UIChooserNodeGroup *pGroupNode = pNode->toGroupNode(); 656 AssertPtrReturn(pGroupNode, 0); 657 if ( pGroupNode->groupType() == UIChooserNodeGroupType_Local 658 && pNode->name() == strSecondSubName) 656 659 { 657 UIChooserNode *pFoundNode = getLocalGroupNode(strFirstSuffix, p GroupNode, fAllGroupsOpened);660 UIChooserNode *pFoundNode = getLocalGroupNode(strFirstSuffix, pNode, fAllGroupsOpened); 658 661 if (UIChooserNodeGroup *pFoundGroupNode = pFoundNode->toGroupNode()) 659 662 if (fAllGroupsOpened && pFoundGroupNode->isClosed()) … … 692 695 AssertMsg(!strFirstSuffix.isEmpty(), ("Invalid group name!")); 693 696 /* Trying to get group node among our children: */ 694 foreach (UIChooserNode *p GroupNode, pParentNode->nodes(UIChooserNodeType_Group))697 foreach (UIChooserNode *pNode, pParentNode->nodes(UIChooserNodeType_Group)) 695 698 { 696 if ( pGroupNode->toGroupNode()->groupType() != UIChooserNodeGroupType_Local 697 && pGroupNode->name() == strSecondSubName) 699 AssertPtrReturn(pNode, 0); 700 UIChooserNodeGroup *pGroupNode = pNode->toGroupNode(); 701 AssertPtrReturn(pGroupNode, 0); 702 if ( ( pGroupNode->groupType() == UIChooserNodeGroupType_Provider 703 || pGroupNode->groupType() == UIChooserNodeGroupType_Profile) 704 && pNode->name() == strSecondSubName) 698 705 { 699 UIChooserNode *pFoundNode = getCloudGroupNode(strFirstSuffix, p GroupNode, fAllGroupsOpened);706 UIChooserNode *pFoundNode = getCloudGroupNode(strFirstSuffix, pNode, fAllGroupsOpened); 700 707 if (UIChooserNodeGroup *pFoundGroupNode = pFoundNode->toGroupNode()) 701 708 if (fAllGroupsOpened && pFoundGroupNode->isClosed()) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserDefs.h
r84371 r84400 42 42 enum UIChooserNodeGroupType 43 43 { 44 UIChooserNodeGroupType_Invalid, 44 45 UIChooserNodeGroupType_Local, 45 46 UIChooserNodeGroupType_Provider, -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r84371 r84400 93 93 { 94 94 return node() ? node()->toGroupNode() : 0; 95 } 96 97 UIChooserNodeGroupType UIChooserItemGroup::groupType() const 98 { 99 return nodeToGroupType() ? nodeToGroupType()->groupType() : UIChooserNodeGroupType_Invalid; 95 100 } 96 101 … … 493 498 /* Are we searching among group-items? */ 494 499 if ( ( iItemSearchFlags & UIChooserItemSearchFlag_LocalGroup 495 && nodeToGroupType()->groupType() == UIChooserNodeGroupType_Local)500 && groupType() == UIChooserNodeGroupType_Local) 496 501 || ( iItemSearchFlags & UIChooserItemSearchFlag_CloudProvider 497 && nodeToGroupType()->groupType() == UIChooserNodeGroupType_Provider)502 && groupType() == UIChooserNodeGroupType_Provider) 498 503 || ( iItemSearchFlags & UIChooserItemSearchFlag_CloudProfile 499 && nodeToGroupType()->groupType() == UIChooserNodeGroupType_Profile))504 && groupType() == UIChooserNodeGroupType_Profile)) 500 505 { 501 506 /* Are we searching by the exact ID? */ … … 703 708 704 709 /* For local items: */ 705 if ( nodeToGroupType()->groupType() == UIChooserNodeGroupType_Local706 && pGroupItem-> nodeToGroupType()->groupType() == UIChooserNodeGroupType_Local)710 if ( groupType() == UIChooserNodeGroupType_Local 711 && pGroupItem->groupType() == UIChooserNodeGroupType_Local) 707 712 { 708 713 /* Make sure passed machine isn't immutable within own group: */ … … 727 732 /* For cloud items: */ 728 733 else 729 if ( nodeToGroupType()->groupType() == UIChooserNodeGroupType_Provider730 && pGroupItem-> nodeToGroupType()->groupType() == UIChooserNodeGroupType_Profile)734 if ( groupType() == UIChooserNodeGroupType_Provider 735 && pGroupItem->groupType() == UIChooserNodeGroupType_Profile) 731 736 { 732 737 /* Make sure passed item is ours: */ … … 745 750 746 751 /* For local items: */ 747 if ( nodeToGroupType()->groupType() == UIChooserNodeGroupType_Local752 if ( groupType() == UIChooserNodeGroupType_Local 748 753 && pMachineItem->cacheType() == UIVirtualMachineItemType_Local) 749 754 { … … 770 775 /* For cloud items: */ 771 776 else 772 if ( nodeToGroupType()->groupType() == UIChooserNodeGroupType_Profile777 if ( groupType() == UIChooserNodeGroupType_Profile 773 778 && pMachineItem->cacheType() == UIVirtualMachineItemType_CloudReal) 774 779 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r83924 r84400 73 73 /** Returns group node reference. */ 74 74 UIChooserNodeGroup *nodeToGroupType() const; 75 76 /** Returns group node type. */ 77 UIChooserNodeGroupType groupType() const; 75 78 76 79 /** Returns whether group is closed. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r84378 r84400 362 362 { 363 363 return isSingleGroupSelected() 364 && firstSelectedItem()-> node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Local;364 && firstSelectedItem()->toGroupItem()->groupType() == UIChooserNodeGroupType_Local; 365 365 } 366 366 … … 368 368 { 369 369 return isSingleGroupSelected() 370 && firstSelectedItem()-> node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Profile;370 && firstSelectedItem()->toGroupItem()->groupType() == UIChooserNodeGroupType_Profile; 371 371 } 372 372 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGroup.cpp
r84378 r84400 120 120 strNodePrefix = UIChooserAbstractModel::definitionOption(UIChooserAbstractModel::NodeDef_GroupPrefixProfile); 121 121 break; 122 default: 123 AssertFailedReturn(QString()); 122 124 } 123 125 const QString strNodeOptionOpened = UIChooserAbstractModel::definitionOption(UIChooserAbstractModel::NodeDef_GroupOptionOpened);
Note:
See TracChangeset
for help on using the changeset viewer.