Changeset 103672 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 4, 2024 4:10:46 PM (9 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp
r102282 r103672 79 79 const QString strFamilyDesc = m_guestOSTypes.last().getFamilyDescription(); 80 80 const QString strSubtype = m_guestOSTypes.last().getSubtype(); 81 QPair<QString, QString> family = QPair<QString, QString>(strFamilyId, strFamilyDesc);82 if (!m_guestOSFamilies.contains(f amily))83 m_guestOSFamilies << f amily;81 UIFamilyInfo fi(strFamilyId, strFamilyDesc); 82 if (!m_guestOSFamilies.contains(fi)) 83 m_guestOSFamilies << fi; 84 84 85 85 /* Acquire arch type: */ … … 106 106 /* Otherwise we'll have to prepare list by arch type: */ 107 107 UIGuestOSTypeManager::UIGuestOSFamilyInfo families; 108 foreach (const UI GuestInfoPair &family, m_guestOSFamilies)109 { 110 const KPlatformArchitecture enmCurrentArch = m_guestOSFamilyArch.value(f amily.first, KPlatformArchitecture_Max);108 foreach (const UIFamilyInfo &fi, m_guestOSFamilies) 109 { 110 const KPlatformArchitecture enmCurrentArch = m_guestOSFamilyArch.value(fi.m_strId, KPlatformArchitecture_Max); 111 111 if ( enmCurrentArch == enmArch 112 112 || enmCurrentArch == KPlatformArchitecture_None) 113 families << f amily;113 families << fi; 114 114 } 115 115 return families; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h
r102282 r103672 40 40 #include "COMEnums.h" 41 41 #include "CGuestOSType.h" 42 43 /** Represents guest OS family info. */ 44 struct UIFamilyInfo 45 { 46 /** Constructs empty family info. */ 47 UIFamilyInfo() 48 {} 49 50 /** Constructs family info with predefined @a strId and @a strDescription. */ 51 UIFamilyInfo(const QString &strId, const QString &strDescription) 52 : m_strId(strId) 53 , m_strDescription(strDescription) 54 {} 55 56 /** Returns whether this family info has the same id as @a other. */ 57 bool operator==(const UIFamilyInfo &other) const 58 { 59 return m_strId == other.m_strId; 60 } 61 62 /** Holds family id. */ 63 QString m_strId; 64 /** Holds family description. */ 65 QString m_strDescription; 66 }; 42 67 43 68 /** A wrapper around CGuestOSType. Some of the properties are cached here for performance. */ … … 87 112 }; 88 113 89 90 114 /** A wrapper and manager class for Guest OS types (IGuestOSType). Logically we structure os types into families 91 115 * e.g. Window, Linux etc. Some families have so-called subtypes which for Linux corresponds to distros, while some … … 99 123 typedef QPair<QString, QString> UIGuestInfoPair; 100 124 /** A list of all OS family pairs. */ 101 typedef QVector<UI GuestInfoPair> UIGuestOSFamilyInfo;125 typedef QVector<UIFamilyInfo> UIGuestOSFamilyInfo; 102 126 /** A list of all OS type pairs. */ 103 127 typedef QVector<UIGuestInfoPair> UIGuestOSTypeInfo; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r102162 r103672 625 625 for (int i = 0; i < families.size(); ++i) 626 626 { 627 m_pComboFamily->addItem(families[i].second); 628 m_pComboFamily->setItemData(i, families[i].first); 627 const UIFamilyInfo fi = families.at(i); 628 m_pComboFamily->addItem(fi.m_strDescription); 629 m_pComboFamily->setItemData(i, fi.m_strId); 629 630 } 630 631 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIGuestOSTypeSelectionButton.cpp
r102152 r103672 112 112 for (int i = 0; i < familyList.size(); ++i) 113 113 { 114 const QPair<QString, QString> &familyInfo = familyList[i];115 QMenu *pSubMenu = m_pMainMenu->addMenu(f amilyInfo.second);116 QStringList subtypeList = uiCommon().guestOSTypeManager().getSubtypeListForFamilyId(f amilyInfo.first);114 const UIFamilyInfo &fi = familyList.at(i); 115 QMenu *pSubMenu = m_pMainMenu->addMenu(fi.m_strDescription); 116 QStringList subtypeList = uiCommon().guestOSTypeManager().getSubtypeListForFamilyId(fi.m_strId); 117 117 118 118 if (subtypeList.isEmpty()) 119 createOSTypeMenu(uiCommon().guestOSTypeManager().getTypeListForFamilyId(f amilyInfo.first), pSubMenu);119 createOSTypeMenu(uiCommon().guestOSTypeManager().getTypeListForFamilyId(fi.m_strId), pSubMenu); 120 120 else 121 121 {
Note:
See TracChangeset
for help on using the changeset viewer.