Changeset 103686 in vbox
- Timestamp:
- Mar 5, 2024 4:07:36 PM (11 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
r103680 r103686 58 58 m_guestOSTypes.clear(); 59 59 m_guestOSFamilies.clear(); 60 m_guestOSSubtypes.clear(); 60 61 m_guestOSSubtypeArch.clear(); 61 62 … … 108 109 } 109 110 111 /* Cache or update subtype info: */ 112 if (!m_guestOSSubtypes.contains(strFamilyId)) 113 m_guestOSSubtypes[strFamilyId] << strSubtype; 114 else 115 { 116 QStringList &subtypes = m_guestOSSubtypes[strFamilyId]; 117 if (!subtypes.contains(strSubtype)) 118 subtypes << strSubtype; 119 } 120 110 121 /* Cache subtype arch type; That will be x86, ARM or None (for *any*): */ 111 122 if (!m_guestOSSubtypeArch.contains(strSubtype)) … … 139 150 KPlatformArchitecture enmArch /* = KPlatformArchitecture_None */) const 140 151 { 141 /* Prepare list by arch type: */ 152 /* Return all subtypes by default: */ 153 if (enmArch == KPlatformArchitecture_None) 154 return m_guestOSSubtypes.value(strFamilyId); 155 156 /* Otherwise we'll have to prepare list by arch type: */ 142 157 QStringList subtypes; 143 foreach (const UIGuestOSType &type, m_guestOSTypes) 144 { 145 if (type.getFamilyId() != strFamilyId) 146 continue; 147 const QString strSubtype = type.getSubtype(); 148 if (strSubtype.isEmpty() || subtypes.contains(strSubtype)) 149 continue; 158 foreach (const QString &strSubtype, m_guestOSSubtypes.value(strFamilyId)) 159 { 150 160 const KPlatformArchitecture enmCurrentArch = m_guestOSSubtypeArch.value(strSubtype, KPlatformArchitecture_Max); 151 if ( enmCurrentArch == enmArch 152 || enmArch == KPlatformArchitecture_None 153 || enmCurrentArch == KPlatformArchitecture_None) 161 if (enmCurrentArch == enmArch || enmCurrentArch == KPlatformArchitecture_None) 154 162 subtypes << strSubtype; 155 163 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h
r103680 r103686 200 200 * is index to m_guestOSTypes list. */ 201 201 QMap<QString, int> m_typeIdIndexMap; 202 /** First item of the pair is family id and the 2nd is family description. */ 202 203 /** Hold the list of guest OS family info. */ 203 204 UIGuestOSFamilyInfo m_guestOSFamilies; 205 /** Hold the list of guest OS subtype info. */ 206 QMap<QString, QStringList> m_guestOSSubtypes; 204 207 205 208 /** Caches arch types on per-subtype basis. */
Note:
See TracChangeset
for help on using the changeset viewer.