Changeset 102102 in vbox
- Timestamp:
- Nov 15, 2023 1:35:02 PM (15 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp
r101593 r102102 27 27 28 28 /* GUI includes: */ 29 #include "UICommon.h" 29 30 #include "UIGuestOSType.h" 30 31 … … 195 196 } 196 197 198 bool UIGuestOSTypeManager::is64Bit(const QString &strTypeId) const 199 { 200 return m_guestOSTypes.value(m_typeIdIndexMap.value(strTypeId, -1)).is64Bit(); 201 } 202 203 KPlatformArchitecture UIGuestOSTypeManager::getPlatformArchitecture(const QString &strTypeId) const 204 { 205 return m_guestOSTypes.value(m_typeIdIndexMap.value(strTypeId, -1)).getPlatformArchitecture(); 206 } 207 197 208 /* static */ 198 209 bool UIGuestOSTypeManager::isDOSType(const QString &strOSTypeId) … … 321 332 return KStorageControllerType_Null; 322 333 } 334 335 bool UIGuestOSType::is64Bit() const 336 { 337 if (m_comGuestOSType.isOk()) 338 return m_comGuestOSType.GetIs64Bit(); 339 return false; 340 } 341 342 KPlatformArchitecture UIGuestOSType::getPlatformArchitecture() const 343 { 344 if (m_comGuestOSType.isOk()) 345 return m_comGuestOSType.GetPlatformArchitecture(); 346 return KPlatformArchitecture_Max; 347 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h
r101519 r102102 70 70 KGraphicsControllerType getRecommendedGraphicsController() const; 71 71 KStorageControllerType getRecommendedDVDStorageController() const; 72 bool is64Bit() const; 73 KPlatformArchitecture getPlatformArchitecture() const; 72 74 /** @} */ 73 75 … … 136 138 bool isLinux(const QString &strTypeId) const; 137 139 bool isWindows(const QString &strTypeId) const; 140 bool is64Bit(const QString &strOSTypeId) const; 141 KPlatformArchitecture getPlatformArchitecture(const QString &strTypeId) const; 138 142 /** @} */ 139 143 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp
r101590 r102102 35 35 36 36 /* GUI includes: */ 37 #include "UICommon.h" 37 38 #include "UIIconPool.h" 38 39 #include "UIExtraDataManager.h" 40 #include "UIGuestOSType.h" 39 41 #include "UIModalWindowManager.h" 40 42 … … 781 783 782 784 /* static */ 783 QString UIIconPoolGeneral::determineOSArchString(const QString &osTypeId) 784 { 785 if (osTypeId.contains("_x64") || osTypeId.contains("_64")) 786 return QString("x64"); 787 else if (osTypeId.contains("arm32")) 788 return QString("A32"); 789 else if (osTypeId.contains("arm64")) 790 return QString("A64"); 791 return QString("32"); 785 QString UIIconPoolGeneral::determineOSArchString(const QString &strOSTypeId) 786 { 787 bool fIs64Bit = uiCommon().guestOSTypeManager().is64Bit(strOSTypeId); 788 KPlatformArchitecture enmPlatformArchitecture = uiCommon().guestOSTypeManager().getPlatformArchitecture(strOSTypeId); 789 790 if (enmPlatformArchitecture == KPlatformArchitecture_ARM) 791 { 792 if (fIs64Bit) 793 return QString("A64"); 794 else 795 return QString("A32"); 796 } 797 else if (enmPlatformArchitecture == KPlatformArchitecture_x86) 798 { 799 if (fIs64Bit) 800 return QString("x64"); 801 else 802 return QString("32"); 803 } 804 return QString(); 792 805 } 793 806 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.h
r101590 r102102 177 177 static void overlayArchitectureTextOnPixmap(const QString &strArch, QPixmap &pixmap); 178 178 /** Returns the architecture text we overlay on guest OS type id icon.*/ 179 static QString determineOSArchString(const QString & osTypeId);179 static QString determineOSArchString(const QString &strOSTypeId); 180 180 /** Holds the singleton instance. */ 181 181 static UIIconPoolGeneral *s_pInstance;
Note:
See TracChangeset
for help on using the changeset viewer.