Changeset 103689 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 5, 2024 6:57:38 PM (9 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
r103688 r103689 59 59 m_guestOSFamilies.clear(); 60 60 m_guestOSSubtypes.clear(); 61 m_guestOSSubtypeArch.clear();62 61 63 62 /* Enumerate guest OS types: */ … … 110 109 111 110 /* Cache or update subtype info: */ 112 UISubtypeInfo si(strSubtype );111 UISubtypeInfo si(strSubtype, enmArch); 113 112 if (!m_guestOSSubtypes.contains(strFamilyId)) 114 113 m_guestOSSubtypes[strFamilyId] << si; … … 118 117 if (!subtypes.contains(si)) 119 118 subtypes << si; 120 } 121 122 /* Cache subtype arch type; That will be x86, ARM or None (for *any*): */ 123 if (!m_guestOSSubtypeArch.contains(strSubtype)) 124 m_guestOSSubtypeArch[strSubtype] = enmArch; 125 else if (m_guestOSSubtypeArch.value(strSubtype) != enmArch) 126 m_guestOSSubtypeArch[strSubtype] = KPlatformArchitecture_None; 119 else 120 { 121 const int iIndex = subtypes.indexOf(si); 122 AssertReturnVoid(iIndex >= 0); 123 if (subtypes.at(iIndex).m_enmArch != enmArch) 124 subtypes[iIndex].m_enmArch = KPlatformArchitecture_None; // means any 125 } 126 } 127 127 } 128 128 … … 157 157 /* Otherwise we'll have to prepare list by arch type: */ 158 158 UIGuestOSSubtypeInfo subtypes; 159 foreach (const UISubtypeInfo &s ubtype, m_guestOSSubtypes.value(strFamilyId))160 { 161 const KPlatformArchitecture enmCurrentArch = m_guestOSSubtypeArch.value(subtype.m_strName, KPlatformArchitecture_Max);159 foreach (const UISubtypeInfo &si, m_guestOSSubtypes.value(strFamilyId)) 160 { 161 const KPlatformArchitecture enmCurrentArch = si.m_enmArch; 162 162 if (enmCurrentArch == enmArch || enmCurrentArch == KPlatformArchitecture_None) 163 subtypes << s ubtype;163 subtypes << si; 164 164 } 165 165 return subtypes; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h
r103688 r103689 86 86 /** Constructs empty subtype info. */ 87 87 UISubtypeInfo() 88 : m_enmArch(KPlatformArchitecture_None) 88 89 {} 89 90 90 91 /** Constructs subtype info. 91 * @param strName Brings the name. */ 92 UISubtypeInfo(const QString &strName) 92 * @param strName Brings the name. 93 * @param enmArch Brings the architecture type. */ 94 UISubtypeInfo(const QString &strName, 95 KPlatformArchitecture enmArch) 93 96 : m_strName(strName) 97 , m_enmArch(enmArch) 94 98 {} 95 99 … … 101 105 102 106 /** Holds the name. */ 103 QString m_strName; 107 QString m_strName; 108 /** Holds the architecture. */ 109 KPlatformArchitecture m_enmArch; 104 110 }; 105 111 … … 230 236 /** Hold the list of guest OS subtype info. */ 231 237 QMap<QString, UIGuestOSSubtypeInfo> m_guestOSSubtypes; 232 233 /** Caches arch types on per-subtype basis. */234 QMap<QString, KPlatformArchitecture> m_guestOSSubtypeArch;235 238 }; 236 239
Note:
See TracChangeset
for help on using the changeset viewer.