VirtualBox

Changeset 101278 in vbox for trunk


Ignore:
Timestamp:
Sep 27, 2023 6:48:22 AM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10523. Refactoring UIGuestOSTypeII to UIGuestOSType.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
8 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r101183 r101278  
    14051405        src/globals/UIErrorString.cpp \
    14061406        src/globals/UIExtension.cpp \
    1407         src/globals/UIGuestOSTypeII.cpp \
     1407        src/globals/UIGuestOSType.cpp \
    14081408        src/globals/UIIconPool.cpp \
    14091409        src/globals/UIImageTools.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r101265 r101278  
    6363#include "UIConverter.h"
    6464#include "UIDesktopWidgetWatchdog.h"
    65 #include "UIGuestOSTypeII.h"
     65#include "UIGuestOSType.h"
    6666#include "UIExtraDataDefs.h"
    6767#include "UIExtraDataManager.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp

    r101277 r101278  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGuestOSTypeII class implementation.
     3 * VBox Qt GUI - UIGuestOSType class implementation.
    44 */
    55
     
    2727
    2828/* GUI includes: */
    29 #include "UIGuestOSTypeII.h"
     29#include "UIGuestOSType.h"
    3030
    3131
     
    5252void UIGuestOSTypeManager::addGuestOSType(const CGuestOSType &comType)
    5353{
    54     m_guestOSTypes << UIGuestOSTypeII(comType);
     54    m_guestOSTypes << UIGuestOSType(comType);
    5555    QPair<QString, QString> family = QPair<QString, QString>(m_guestOSTypes.last().getFamilyId(), m_guestOSTypes.last().getFamilyDescription());
    5656    if (!m_guestOSFamilies.contains(family))
     
    6666{
    6767    QStringList variantList;
    68     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     68    foreach (const UIGuestOSType &type, m_guestOSTypes)
    6969    {
    7070        if (type.getFamilyId() != strFamilyId)
     
    8080{
    8181    UIGuestOSTypeInfo typeInfoList;
    82     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     82    foreach (const UIGuestOSType &type, m_guestOSTypes)
    8383    {
    8484        if (type.getFamilyId() != strFamilyId)
     
    9898        return typeInfoList;
    9999
    100     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     100    foreach (const UIGuestOSType &type, m_guestOSTypes)
    101101    {
    102102        if (type.getVariant() != strVariant)
     
    109109}
    110110
    111 UIGuestOSTypeII UIGuestOSTypeManager::findGuestTypeById(const QString &strTypeId) const
    112 {
    113     if (strTypeId.isEmpty())
    114         return UIGuestOSTypeII();
    115     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     111UIGuestOSType UIGuestOSTypeManager::findGuestTypeById(const QString &strTypeId) const
     112{
     113    if (strTypeId.isEmpty())
     114        return UIGuestOSType();
     115    foreach (const UIGuestOSType &type, m_guestOSTypes)
    116116    {
    117117        if (type.getId() == strTypeId)
    118118            return type;
    119119    }
    120     return UIGuestOSTypeII();
     120    return UIGuestOSType();
    121121}
    122122
     
    125125    if (strTypeId.isEmpty())
    126126        return KGraphicsControllerType_Null;
    127     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     127    foreach (const UIGuestOSType &type, m_guestOSTypes)
    128128    {
    129129        if (type.getId() == strTypeId)
     
    137137    if (strTypeId.isEmpty())
    138138        return 0;
    139     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     139    foreach (const UIGuestOSType &type, m_guestOSTypes)
    140140    {
    141141        if (type.getId() == strTypeId)
     
    149149    if (strTypeId.isEmpty())
    150150        return 0;
    151     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     151    foreach (const UIGuestOSType &type, m_guestOSTypes)
    152152    {
    153153        if (type.getId() == strTypeId)
     
    161161    if (strTypeId.isEmpty())
    162162        return KFirmwareType_Max;
    163     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     163    foreach (const UIGuestOSType &type, m_guestOSTypes)
    164164    {
    165165        if (type.getId() == strTypeId)
     
    173173    if (strTypeId.isEmpty())
    174174        return QString();
    175     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     175    foreach (const UIGuestOSType &type, m_guestOSTypes)
    176176    {
    177177        if (type.getId() == strTypeId)
     
    185185    if (strTypeId.isEmpty())
    186186        return 0;
    187     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     187    foreach (const UIGuestOSType &type, m_guestOSTypes)
    188188    {
    189189        if (type.getId() == strTypeId)
     
    197197    if (strTypeId.isEmpty())
    198198        return KStorageBus_Null;
    199     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     199    foreach (const UIGuestOSType &type, m_guestOSTypes)
    200200    {
    201201        if (type.getId() == strTypeId)
     
    209209    if (strTypeId.isEmpty())
    210210        return KStorageBus_Null;
    211     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     211    foreach (const UIGuestOSType &type, m_guestOSTypes)
    212212    {
    213213        if (type.getId() == strTypeId)
     
    222222    if (strTypeId.isEmpty())
    223223        return false;
    224     foreach (const UIGuestOSTypeII &type, m_guestOSTypes)
     224    foreach (const UIGuestOSType &type, m_guestOSTypes)
    225225    {
    226226        if (type.getId() == strTypeId)
     
    230230}
    231231
    232 UIGuestOSTypeII::UIGuestOSTypeII()
    233 {
    234 }
    235 
    236 UIGuestOSTypeII::UIGuestOSTypeII(const CGuestOSType &comGuestOSType)
     232UIGuestOSType::UIGuestOSType()
     233{
     234}
     235
     236UIGuestOSType::UIGuestOSType(const CGuestOSType &comGuestOSType)
    237237    : m_comGuestOSType(comGuestOSType)
    238238{
    239239}
    240240
    241 bool UIGuestOSTypeII::isOk() const
     241bool UIGuestOSType::isOk() const
    242242{
    243243    return (!m_comGuestOSType.isNull() && m_comGuestOSType.isOk());
    244244}
    245245
    246 const QString &UIGuestOSTypeII::getFamilyId() const
     246const QString &UIGuestOSType::getFamilyId() const
    247247{
    248248    if (m_strFamilyId.isEmpty() && m_comGuestOSType.isOk())
     
    251251}
    252252
    253 const QString &UIGuestOSTypeII::getFamilyDescription() const
     253const QString &UIGuestOSType::getFamilyDescription() const
    254254{
    255255    if (m_strFamilyDescription.isEmpty() && m_comGuestOSType.isOk())
     
    258258}
    259259
    260 const QString &UIGuestOSTypeII::getId() const
     260const QString &UIGuestOSType::getId() const
    261261{
    262262    if (m_strId.isEmpty() && m_comGuestOSType.isOk())
     
    265265}
    266266
    267 const QString &UIGuestOSTypeII::getVariant() const
     267const QString &UIGuestOSType::getVariant() const
    268268{
    269269    if (m_strVariant.isEmpty() && m_comGuestOSType.isOk())
     
    272272}
    273273
    274 const QString &UIGuestOSTypeII::getDescription() const
     274const QString &UIGuestOSType::getDescription() const
    275275{
    276276    if (m_strDescription.isEmpty() && m_comGuestOSType.isOk())
     
    279279}
    280280
    281 KStorageBus UIGuestOSTypeII::getRecommendedHDStorageBus() const
     281KStorageBus UIGuestOSType::getRecommendedHDStorageBus() const
    282282{
    283283    if (m_comGuestOSType.isOk())
     
    286286}
    287287
    288 ULONG UIGuestOSTypeII::getRecommendedRAM() const
     288ULONG UIGuestOSType::getRecommendedRAM() const
    289289{
    290290    if (m_comGuestOSType.isOk())
     
    293293}
    294294
    295 KStorageBus UIGuestOSTypeII::getRecommendedDVDStorageBus() const
     295KStorageBus UIGuestOSType::getRecommendedDVDStorageBus() const
    296296{
    297297    if (m_comGuestOSType.isOk())
     
    300300}
    301301
    302 ULONG UIGuestOSTypeII::getRecommendedCPUCount() const
     302ULONG UIGuestOSType::getRecommendedCPUCount() const
    303303{
    304304    if (m_comGuestOSType.isOk())
     
    307307}
    308308
    309 KFirmwareType UIGuestOSTypeII::getRecommendedFirmware() const
     309KFirmwareType UIGuestOSType::getRecommendedFirmware() const
    310310{
    311311    if (m_comGuestOSType.isOk())
     
    314314}
    315315
    316 bool UIGuestOSTypeII::getRecommendedFloppy() const
     316bool UIGuestOSType::getRecommendedFloppy() const
    317317{
    318318    if (m_comGuestOSType.isOk())
     
    321321}
    322322
    323 LONG64 UIGuestOSTypeII::getRecommendedHDD() const
     323LONG64 UIGuestOSType::getRecommendedHDD() const
    324324{
    325325    if (m_comGuestOSType.isOk())
     
    328328}
    329329
    330 KGraphicsControllerType UIGuestOSTypeII::getRecommendedGraphicsController() const
     330KGraphicsControllerType UIGuestOSType::getRecommendedGraphicsController() const
    331331{
    332332    if (m_comGuestOSType.isOk())
     
    335335}
    336336
    337 bool UIGuestOSTypeII::operator==(const UIGuestOSTypeII &other)
     337bool UIGuestOSType::operator==(const UIGuestOSType &other)
    338338{
    339339    return m_comGuestOSType == other.m_comGuestOSType;
    340340}
    341341
    342 bool UIGuestOSTypeII::operator!=(const UIGuestOSTypeII &other)
     342bool UIGuestOSType::operator!=(const UIGuestOSType &other)
    343343{
    344344    return m_comGuestOSType != other.m_comGuestOSType;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h

    r101277 r101278  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGuestOSTypeII class declaration.
     3 * VBox Qt GUI - UIGuestOSType class declaration.
    44 */
    55
     
    2626 */
    2727
    28 #ifndef FEQT_INCLUDED_SRC_globals_UIGuestOSTypeII_h
    29 #define FEQT_INCLUDED_SRC_globals_UIGuestOSTypeII_h
     28#ifndef FEQT_INCLUDED_SRC_globals_UIGuestOSType_h
     29#define FEQT_INCLUDED_SRC_globals_UIGuestOSType_h
    3030#ifndef RT_WITHOUT_PRAGMA_ONCE
    3131# pragma once
     
    4141#include "CGuestOSType.h"
    4242
    43 class UIGuestOSTypeII;
     43class UIGuestOSType;
    4444
    4545
     
    6161    UIGuestOSTypeInfo getTypeListForVariant(const QString &strVariant) const;
    6262
    63     UIGuestOSTypeII findGuestTypeById(const QString &strTypeId) const;
     63    UIGuestOSType findGuestTypeById(const QString &strTypeId) const;
    6464
    6565    KGraphicsControllerType getRecommendedGraphicsController(const QString &strTypeId) const;
     
    7777    void addGuestOSType(const CGuestOSType &comType);
    7878
    79     QVector<UIGuestOSTypeII> m_guestOSTypes;
     79    QVector<UIGuestOSType> m_guestOSTypes;
    8080    /* First item of the pair is family id and the 2nd is family description. */
    8181    UIGuestOSTypeInfo m_guestOSFamilies;
     
    8484
    8585/** A wrapper around CGuestOSType. */
    86 class SHARED_LIBRARY_STUFF UIGuestOSTypeII
     86class SHARED_LIBRARY_STUFF UIGuestOSType
    8787{
    8888
     
    9090
    9191
    92     UIGuestOSTypeII(const CGuestOSType &comGuestOSType);
    93     UIGuestOSTypeII();
     92    UIGuestOSType(const CGuestOSType &comGuestOSType);
     93    UIGuestOSType();
    9494
    9595    const QString &getFamilyId() const;
     
    112112
    113113    bool isOk() const;
    114     bool operator==(const UIGuestOSTypeII &other);
    115     bool operator!=(const UIGuestOSTypeII &other);
     114    bool operator==(const UIGuestOSType &other);
     115    bool operator!=(const UIGuestOSType &other);
    116116
    117117private:
     
    130130};
    131131
    132 #endif /* !FEQT_INCLUDED_SRC_globals_UIGuestOSTypeII_h */
     132#endif /* !FEQT_INCLUDED_SRC_globals_UIGuestOSType_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp

    r101272 r101278  
    256256    const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();
    257257    AssertReturn(pGuestOSTypeManager, false);
    258     const UIGuestOSTypeII &type = pGuestOSTypeManager->findGuestTypeById(strTypeId);
     258    const UIGuestOSType &type = pGuestOSTypeManager->findGuestTypeById(strTypeId);
    259259    if (!type.isOk())
    260260        return false;
     
    312312    return m_strFamilyId;
    313313}
    314 
    315 // void UINameAndSystemEditor::setType(const CGuestOSType &enmType)
    316 // {
    317 //     // WORKAROUND:
    318 //     // We're getting here with a NULL enmType when creating new VMs.
    319 //     // Very annoying, so just workarounded for now.
    320 //     /** @todo find out the reason and way to fix that.. */
    321 //     if (enmType.isNull())
    322 //         return;
    323 
    324 //     /* Pass to function above: */
    325 //     setTypeId(enmType.GetId(), enmType.GetFamilyId());
    326 // }
    327 
    328 // UIGuestOSTypeII UINameAndSystemEditor::type() const
    329 // {
    330 //     const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();
    331 //     AssertReturn(pGuestOSTypeManager, UIGuestOSTypeII());
    332 //     return pGuestOSTypeManager->findGuestTypeById(m_strTypeId);
    333 // }
    334314
    335315void UINameAndSystemEditor::markNameEditor(bool fError)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.h

    r101277 r101278  
    3434/* GUI includes: */
    3535#include "UIEditor.h"
    36 #include "UIGuestOSTypeII.h"
     36#include "UIGuestOSType.h"
    3737
    3838/* COM includes: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r101272 r101278  
    3232/* GUI includes: */
    3333#include "UICommon.h"
    34 #include "UIGuestOSTypeII.h"
     34#include "UIGuestOSType.h"
    3535#include "UIMedium.h"
    3636#include "UINotificationCenter.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp

    r101272 r101278  
    3737#include "QIToolButton.h"
    3838#include "UIIconPool.h"
    39 #include "UIGuestOSTypeII.h"
     39#include "UIGuestOSType.h"
    4040#include "UIMediaComboBox.h"
    4141#include "UIMediumSelector.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePage.cpp

    r101273 r101278  
    3333#include "UIBaseMemoryEditor.h"
    3434#include "UICommon.h"
    35 #include "UIGuestOSTypeII.h"
     35#include "UIGuestOSType.h"
    3636#include "UIVirtualCPUEditor.h"
    3737#include "UIWizardNewVM.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMSummaryPage.cpp

    r101272 r101278  
    3636#include "QITreeView.h"
    3737#include "UIIconPool.h"
    38 #include "UIGuestOSTypeII.h"
     38#include "UIGuestOSType.h"
    3939#include "UIMessageCenter.h"
    4040#include "UINotificationCenter.h"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette