- Timestamp:
- Nov 20, 2023 3:05:27 PM (15 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp
r102152 r102153 68 68 } 69 69 70 const UIGuestOSTypeManager::UIGuestOSFamilyInfo &UIGuestOSTypeManager::getFamilies() const70 UIGuestOSTypeManager::UIGuestOSFamilyInfo UIGuestOSTypeManager::getFamilies() const 71 71 { 72 72 return m_guestOSFamilies; … … 75 75 QStringList UIGuestOSTypeManager::getSubtypeListForFamilyId(const QString &strFamilyId) const 76 76 { 77 QStringList subtype List;77 QStringList subtypes; 78 78 foreach (const UIGuestOSType &type, m_guestOSTypes) 79 79 { 80 80 if (type.getFamilyId() != strFamilyId) 81 81 continue; 82 const QString &strSubtype = type.getSubtype(); 83 if (!strSubtype.isEmpty() && !subtypeList.contains(strSubtype)) 84 subtypeList << strSubtype; 82 const QString strSubtype = type.getSubtype(); 83 if (strSubtype.isEmpty() || subtypes.contains(strSubtype)) 84 continue; 85 subtypes << strSubtype; 85 86 } 86 return subtype List;87 return subtypes; 87 88 } 88 89 … … 95 96 continue; 96 97 QPair<QString, QString> info(type.getId(), type.getDescription()); 97 98 if (!typeInfoList.contains(info))99 98 if (typeInfoList.contains(info)) 99 continue; 100 typeInfoList << info; 100 101 } 101 102 return typeInfoList; … … 107 108 if (strSubtype.isEmpty()) 108 109 return typeInfoList; 109 110 110 foreach (const UIGuestOSType &type, m_guestOSTypes) 111 111 { … … 113 113 continue; 114 114 QPair<QString, QString> info(type.getId(), type.getDescription()); 115 if (!typeInfoList.contains(info)) 116 typeInfoList << info; 115 if (typeInfoList.contains(info)) 116 continue; 117 typeInfoList << info; 117 118 } 118 119 return typeInfoList; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h
r102152 r102153 114 114 115 115 /** Returns a list of all families (id and description). */ 116 const UIGuestOSFamilyInfo &getFamilies() const;116 UIGuestOSFamilyInfo getFamilies() const; 117 117 /** Returns the list of subtypes for @p strFamilyId. This may be an empty list. */ 118 QStringList 118 QStringList getSubtypeListForFamilyId(const QString &strFamilyId) const; 119 119 /** Returns a list of OS types for the @p strFamilyId. */ 120 UIGuestOSTypeInfo 120 UIGuestOSTypeInfo getTypeListForFamilyId(const QString &strFamilyId) const; 121 121 /** Returns a list of OS types for the @p strSubtype. */ 122 UIGuestOSTypeInfo 122 UIGuestOSTypeInfo getTypeListForSubtype(const QString &strSubtype) const; 123 123 124 124 static bool isDOSType(const QString &strOSTypeId);
Note:
See TracChangeset
for help on using the changeset viewer.