Changeset 101593 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Oct 25, 2023 3:37:09 PM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 159677
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/GuestOSTypeImpl.cpp
r101215 r101593 100 100 unconst(mFamilyID) = ostype.familyId; 101 101 unconst(mFamilyDescription) = ostype.familyDescription; 102 unconst(mOS Variant) = ostype.variant;102 unconst(mOSSubtype) = ostype.subtype; 103 103 unconst(mID) = ostype.id; 104 104 unconst(mDescription) = ostype.description; … … 159 159 160 160 161 HRESULT GuestOSType::get Variant(com::Utf8Str &aVariant)162 { 163 /* mOS Variantis constant during life time, no need to lock */164 a Variant = mOSVariant;161 HRESULT GuestOSType::getSubtype(com::Utf8Str &aSubtype) 162 { 163 /* mOSSubtype is constant during life time, no need to lock */ 164 aSubtype = mOSSubtype; 165 165 166 166 return S_OK; -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r101471 r101593 4518 4518 /** 4519 4519 * Walk the list of GuestOSType objects and return a list of guest OS 4520 * variants which correspond to the supplied guest OS family ID.4520 * subtypes which correspond to the supplied guest OS family ID. 4521 4521 * 4522 4522 * @param strOSFamily Guest OS family ID. 4523 * @param aOS Variants Where to store the list of guest OS variants.4523 * @param aOSSubtypes Where to store the list of guest OS subtypes. 4524 4524 * 4525 4525 * @note Locks the guest OS types list for reading. 4526 4526 */ 4527 HRESULT VirtualBox::getGuestOS VariantsByFamilyId(const Utf8Str &strOSFamily,4528 std::vector<com::Utf8Str> &aOS Variants)4529 { 4530 std::list<com::Utf8Str> allOS Variants;4527 HRESULT VirtualBox::getGuestOSSubtypesByFamilyId(const Utf8Str &strOSFamily, 4528 std::vector<com::Utf8Str> &aOSSubtypes) 4529 { 4530 std::list<com::Utf8Str> allOSSubtypes; 4531 4531 4532 4532 AutoReadLock alock(m->allGuestOSTypes.getLockHandle() COMMA_LOCKVAL_SRC_POS); … … 4556 4556 if (familyId.compare(strOSFamily, Utf8Str::CaseInsensitive) == 0) 4557 4557 { 4558 const Utf8Str &strOS Variant = (*it)->i_variant();4559 if (!strOS Variant.isEmpty())4560 allOS Variants.push_back(strOSVariant);4558 const Utf8Str &strOSSubtype = (*it)->i_subtype(); 4559 if (!strOSSubtype.isEmpty()) 4560 allOSSubtypes.push_back(strOSSubtype); 4561 4561 } 4562 4562 } 4563 4563 4564 4564 /* throw out any duplicates */ 4565 allOS Variants.sort();4566 allOS Variants.unique();4567 4568 aOS Variants.resize(allOSVariants.size());4565 allOSSubtypes.sort(); 4566 allOSSubtypes.unique(); 4567 4568 aOSSubtypes.resize(allOSSubtypes.size()); 4569 4569 size_t i = 0; 4570 for (std::list<com::Utf8Str>::const_iterator it = allOS Variants.begin();4571 it != allOS Variants.end(); ++it, ++i)4572 aOS Variants[i] = (*it);4570 for (std::list<com::Utf8Str>::const_iterator it = allOSSubtypes.begin(); 4571 it != allOSSubtypes.end(); ++it, ++i) 4572 aOSSubtypes[i] = (*it); 4573 4573 4574 4574 return S_OK; … … 4577 4577 /** 4578 4578 * Walk the list of GuestOSType objects and return a list of guest OS 4579 * descriptions which correspond to the supplied guest OS variant.4580 * 4581 * @param strOS Variant Guest OS variant.4579 * descriptions which correspond to the supplied guest OS subtype. 4580 * 4581 * @param strOSSubtype Guest OS subtype. 4582 4582 * @param aGuestOSDescs Where to store the list of guest OS descriptions.. 4583 4583 * 4584 4584 * @note Locks the guest OS types list for reading. 4585 4585 */ 4586 HRESULT VirtualBox::getGuestOSDescsBy Variant(const Utf8Str &strOSVariant,4586 HRESULT VirtualBox::getGuestOSDescsBySubtype(const Utf8Str &strOSSubtype, 4587 4587 std::vector<com::Utf8Str> &aGuestOSDescs) 4588 4588 { … … 4591 4591 AutoReadLock alock(m->allGuestOSTypes.getLockHandle() COMMA_LOCKVAL_SRC_POS); 4592 4592 4593 bool fFoundGuestOS Variant= false;4593 bool fFoundGuestOSSubtype = false; 4594 4594 for (GuestOSTypesOList::const_iterator it = m->allGuestOSTypes.begin(); 4595 4595 it != m->allGuestOSTypes.end(); ++it) 4596 4596 { 4597 const Utf8Str &guestOS Variant = (*it)->i_variant();4598 /* Only some guest OS types have a populated variantvalue. */4599 if (guestOS Variant.isNotEmpty() &&4600 guestOS Variant.compare(strOSVariant, Utf8Str::CaseInsensitive) == 0)4601 { 4602 fFoundGuestOS Variant= true;4597 const Utf8Str &guestOSSubtype = (*it)->i_subtype(); 4598 /* Only some guest OS types have a populated subtype value. */ 4599 if (guestOSSubtype.isNotEmpty() && 4600 guestOSSubtype.compare(strOSSubtype, Utf8Str::CaseInsensitive) == 0) 4601 { 4602 fFoundGuestOSSubtype = true; 4603 4603 break; 4604 4604 } 4605 4605 } 4606 4606 4607 if (!fFoundGuestOS Variant)4607 if (!fFoundGuestOSSubtype) 4608 4608 return setError(VBOX_E_OBJECT_NOT_FOUND, 4609 tr("'%s' is not a valid guest OS variant."), strOSVariant.c_str());4609 tr("'%s' is not a valid guest OS subtype."), strOSSubtype.c_str()); 4610 4610 4611 4611 for (GuestOSTypesOList::const_iterator it = m->allGuestOSTypes.begin(); 4612 4612 it != m->allGuestOSTypes.end(); ++it) 4613 4613 { 4614 const Utf8Str &guestOS Variant = (*it)->i_variant();4615 /* Only some guest OS types have a populated variantvalue. */4616 if (guestOS Variant.isNotEmpty() &&4617 guestOS Variant.compare(strOSVariant, Utf8Str::CaseInsensitive) == 0)4614 const Utf8Str &guestOSSubtype = (*it)->i_subtype(); 4615 /* Only some guest OS types have a populated subtype value. */ 4616 if (guestOSSubtype.isNotEmpty() && 4617 guestOSSubtype.compare(strOSSubtype, Utf8Str::CaseInsensitive) == 0) 4618 4618 { 4619 4619 const Utf8Str &strOSDesc = (*it)->i_description();
Note:
See TracChangeset
for help on using the changeset viewer.