Changeset 103673 in vbox
- Timestamp:
- Mar 4, 2024 4:52:41 PM (13 months ago)
- svn:sync-xref-src-repo-rev:
- 162033
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp
r103672 r103673 51 51 m_guestOSTypes.clear(); 52 52 m_guestOSFamilies.clear(); 53 m_guestOSFamilyArch.clear();54 53 m_guestOSSubtypeArch.clear(); 55 54 … … 74 73 void UIGuestOSTypeManager::addGuestOSType(const CGuestOSType &comType) 75 74 { 75 /* Append guest OS type to a list of cached wrappers: */ 76 76 m_guestOSTypes.append(UIGuestOSType(comType)); 77 77 m_typeIdIndexMap[m_guestOSTypes.last().getId()] = m_guestOSTypes.size() - 1; 78 79 /* Acquire a bit of attributes: */ 78 80 const QString strFamilyId = m_guestOSTypes.last().getFamilyId(); 79 81 const QString strFamilyDesc = m_guestOSTypes.last().getFamilyDescription(); 80 82 const QString strSubtype = m_guestOSTypes.last().getSubtype(); 81 UIFamilyInfo fi(strFamilyId, strFamilyDesc); 83 const KPlatformArchitecture enmArch = m_guestOSTypes.last().getPlatformArchitecture(); 84 85 /* Cache or update family info: */ 86 UIFamilyInfo fi(strFamilyId, strFamilyDesc, enmArch); 82 87 if (!m_guestOSFamilies.contains(fi)) 83 88 m_guestOSFamilies << fi; 84 85 /* Acquire arch type: */86 const KPlatformArchitecture enmArch = m_guestOSTypes.last().getPlatformArchitecture();87 /* Cache family arch type; That will be x86, ARM or None (for *any*): */88 if (!m_guestOSFamilyArch.contains(strFamilyId))89 m_guestOSFamilyArch[strFamilyId] = enmArch;90 else if (m_guestOSFamilyArch.value(strFamilyId) != enmArch)91 m_guestOSFamilyArch[strFamilyId] = KPlatformArchitecture_None; 89 else 90 { 91 const int iIndex = m_guestOSFamilies.indexOf(fi); 92 AssertReturnVoid(iIndex >= 0); 93 if (m_guestOSFamilies.at(iIndex).m_enmArch != enmArch) 94 m_guestOSFamilies[iIndex].m_enmArch = KPlatformArchitecture_None; // means any 95 } 96 92 97 /* Cache subtype arch type; That will be x86, ARM or None (for *any*): */ 93 98 if (!m_guestOSSubtypeArch.contains(strSubtype)) … … 108 113 foreach (const UIFamilyInfo &fi, m_guestOSFamilies) 109 114 { 110 const KPlatformArchitecture enmCurrentArch = m_guestOSFamilyArch.value(fi.m_strId, KPlatformArchitecture_Max);115 const KPlatformArchitecture enmCurrentArch = fi.m_enmArch; 111 116 if ( enmCurrentArch == enmArch 112 117 || enmCurrentArch == KPlatformArchitecture_None) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h
r103672 r103673 46 46 /** Constructs empty family info. */ 47 47 UIFamilyInfo() 48 : m_enmArch(KPlatformArchitecture_None) 48 49 {} 49 50 50 /** Constructs family info with predefined @a strId and @a strDescription. */ 51 UIFamilyInfo(const QString &strId, const QString &strDescription) 51 /** Constructs family info. 52 * @param strId Brings the family ID. 53 * @param strDescription Brings the family description. 54 * @param enmArch Brings the family architecture. */ 55 UIFamilyInfo(const QString &strId, 56 const QString &strDescription, 57 KPlatformArchitecture enmArch) 52 58 : m_strId(strId) 53 59 , m_strDescription(strDescription) 60 , m_enmArch(enmArch) 54 61 {} 55 62 … … 61 68 62 69 /** Holds family id. */ 63 QString m_strId;70 QString m_strId; 64 71 /** Holds family description. */ 65 QString m_strDescription; 72 QString m_strDescription; 73 /** Holds family architecture. */ 74 KPlatformArchitecture m_enmArch; 66 75 }; 67 76 … … 184 193 UIGuestOSFamilyInfo m_guestOSFamilies; 185 194 186 /** Caches arch types on per-family basis. */187 QMap<QString, KPlatformArchitecture> m_guestOSFamilyArch;188 195 /** Caches arch types on per-subtype basis. */ 189 196 QMap<QString, KPlatformArchitecture> m_guestOSSubtypeArch;
Note:
See TracChangeset
for help on using the changeset viewer.