VirtualBox

Changeset 32894 in vbox


Ignore:
Timestamp:
Oct 5, 2010 9:03:39 AM (14 years ago)
Author:
vboxsync
Message:

Main: clean up GuestOSType constructor

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/GuestOSTypeImpl.cpp

    r32531 r32894  
    7070 * @param aHDDSize           recommended HDD size in bytes
    7171 */
    72 HRESULT GuestOSType::init(const char *aFamilyId, const char *aFamilyDescription,
     72HRESULT GuestOSType::init(const Global::OSType &ostype)/*const char *aFamilyId, const char *aFamilyDescription,
    7373                          const char *aId, const char *aDescription,
    7474                          VBOXOSTYPE aOSType, uint32_t aOSHint,
     
    8080                          StorageControllerType_T aHdStorageControllerType,
    8181                          StorageBus_T aHdStorageBusType,
    82                           ChipsetType_T aChipsetType)
     82                          ChipsetType_T aChipsetType*/
    8383{
    8484#if 0
     
    9898#endif
    9999
    100     ComAssertRet(aFamilyId && aFamilyDescription && aId && aDescription, E_INVALIDARG);
     100    ComAssertRet(ostype.familyId && ostype.familyDescription && ostype.id && ostype.description, E_INVALIDARG);
    101101
    102102    /* Enclose the state transition NotReady->InInit->Ready */
     
    104104    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    105105
    106     unconst(mFamilyID) = aFamilyId;
    107     unconst(mFamilyDescription) = aFamilyDescription;
    108     unconst(mID) = aId;
    109     unconst(mDescription) = aDescription;
    110     unconst(mOSType) = aOSType;
    111     unconst(mOSHint) = aOSHint;
    112     unconst(mRAMSize) = aRAMSize;
    113     unconst(mVRAMSize) = aVRAMSize;
    114     unconst(mHDDSize) = aHDDSize;
    115     unconst(mNetworkAdapterType)       = aNetworkAdapterType;
    116     unconst(mNumSerialEnabled)         = aNumSerialEnabled;
    117     unconst(mDvdStorageControllerType) = aDvdStorageControllerType;
    118     unconst(mDvdStorageBusType)        = aDvdStorageBusType;
    119     unconst(mHdStorageControllerType)  = aHdStorageControllerType;
    120     unconst(mHdStorageBusType)         = aHdStorageBusType;
    121     unconst(mChipsetType)              = aChipsetType;
     106    unconst(mFamilyID)                  = ostype.familyId;
     107    unconst(mFamilyDescription)         = ostype.familyDescription;
     108    unconst(mID)                        = ostype.id;
     109    unconst(mDescription)               = ostype.description;
     110    unconst(mOSType)                    = ostype.osType;
     111    unconst(mOSHint)                    = ostype.osHint;
     112    unconst(mRAMSize)                   = ostype.recommendedRAM;
     113    unconst(mVRAMSize)                  = ostype.recommendedVRAM;
     114    unconst(mHDDSize)                   = ostype.recommendedHDD;
     115    unconst(mNetworkAdapterType)        = ostype.networkAdapterType;
     116    unconst(mNumSerialEnabled)          = ostype.numSerialEnabled;
     117    unconst(mDvdStorageControllerType)  = ostype.dvdStorageControllerType;
     118    unconst(mDvdStorageBusType)         = ostype.dvdStorageBusType;
     119    unconst(mHdStorageControllerType)   = ostype.hdStorageControllerType;
     120    unconst(mHdStorageBusType)          = ostype.hdStorageBusType;
     121    unconst(mChipsetType)               = ostype.chipsetType;
    122122
    123123    /* Confirm a successful initialization when it's the case */
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r32727 r32894  
    442442
    443443        /* guest OS type objects, needed by machines */
    444         for (size_t i = 0; i < RT_ELEMENTS(Global::sOSTypes); ++ i)
    445         {
    446             ComObjPtr <GuestOSType> guestOSTypeObj;
     444        for (size_t i = 0; i < RT_ELEMENTS(Global::sOSTypes); ++i)
     445        {
     446            ComObjPtr<GuestOSType> guestOSTypeObj;
    447447            rc = guestOSTypeObj.createObject();
    448448            if (SUCCEEDED(rc))
    449449            {
    450                 rc = guestOSTypeObj->init(Global::sOSTypes[i].familyId,
    451                                           Global::sOSTypes[i].familyDescription,
    452                                           Global::sOSTypes[i].id,
    453                                           Global::sOSTypes[i].description,
    454                                           Global::sOSTypes[i].osType,
    455                                           Global::sOSTypes[i].osHint,
    456                                           Global::sOSTypes[i].recommendedRAM,
    457                                           Global::sOSTypes[i].recommendedVRAM,
    458                                           Global::sOSTypes[i].recommendedHDD,
    459                                           Global::sOSTypes[i].networkAdapterType,
    460                                           Global::sOSTypes[i].numSerialEnabled,
    461                                           Global::sOSTypes[i].dvdStorageControllerType,
    462                                           Global::sOSTypes[i].dvdStorageBusType,
    463                                           Global::sOSTypes[i].hdStorageControllerType,
    464                                           Global::sOSTypes[i].hdStorageBusType,
    465                                           Global::sOSTypes[i].chipsetType);
     450                rc = guestOSTypeObj->init(Global::sOSTypes[i]);
    466451                if (SUCCEEDED(rc))
    467452                    m->allGuestOSTypes.addChild(guestOSTypeObj);
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r32531 r32894  
    4747
    4848    // public initializer/uninitializer for internal purposes only
    49     HRESULT init(const char *aFamilyId, const char *aFamilyDescription,
    50                  const char *aId, const char *aDescription,
    51                  VBOXOSTYPE aOSType, uint32_t aOSHint,
    52                  uint32_t aRAMSize, uint32_t aVRAMSize, uint64_t aHDDSize,
    53                  NetworkAdapterType_T aNetworkAdapterType, uint32_t numSerialEnabled,
    54                  StorageControllerType_T aDvdStorageControllerType,
    55                  StorageBus_T aDvdStorageBusType,
    56                  StorageControllerType_T aHdStorageControllerType,
    57                  StorageBus_T aHdStorageBusType,
    58                  ChipsetType_T aChipsetType);
     49    HRESULT init(const Global::OSType &ostype);
    5950    void uninit();
    6051
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