Changeset 84462 in vbox for trunk/src/VBox
- Timestamp:
- May 22, 2020 1:47:23 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r84420 r84462 936 936 m_pNameEditorWidget->close(); 937 937 938 /* Enumerate all the group names: */939 QStringList groupNames;940 foreach (UIChooserItem *pItem, parentItem()->items( UIChooserNodeType_Group))938 /* Enumerate all the used machine and group names: */ 939 QStringList usedNames; 940 foreach (UIChooserItem *pItem, parentItem()->items()) 941 941 { 942 942 AssertPtrReturnVoid(pItem); 943 UIChooserItemGroup *pGroupItem = pItem->toGroupItem();944 AssertPtrReturnVoid(pGroupItem);945 if (pGroupItem->groupType() == UIChooserNodeGroupType_Local)946 groupNames << pItem->name();943 if ( pItem->type() == UIChooserNodeType_Machine 944 || ( pItem->type() == UIChooserNodeType_Group 945 && pItem->toGroupItem()->groupType() == UIChooserNodeGroupType_Local)) 946 usedNames << pItem->name(); 947 947 } 948 948 /* If proposed name is empty or not unique, reject it: */ 949 949 QString strNewName = m_pNameEditorWidget->text().trimmed(); 950 if (strNewName.isEmpty() || groupNames.contains(strNewName))950 if (strNewName.isEmpty() || usedNames.contains(strNewName)) 951 951 return; 952 952
Note:
See TracChangeset
for help on using the changeset viewer.