Changeset 31539 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Aug 10, 2010 3:40:18 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64639
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r31481 r31539 1718 1718 MachineConfigFile::MachineConfigFile(const Utf8Str *pstrFilename) 1719 1719 : ConfigFileBase(pstrFilename), 1720 fNameSync(true),1721 fTeleporterEnabled(false),1722 uTeleporterPort(0),1723 fRTCUseUTC(false),1724 1720 fCurrentStateModified(true), 1725 1721 fAborted(false) … … 1778 1774 return ( (this == &c) 1779 1775 || ( (uuid == c.uuid) 1780 && (strName == c.strName) 1781 && (fNameSync == c.fNameSync) 1782 && (strDescription == c.strDescription) 1783 && (strOsType == c.strOsType) 1776 && (machineUserData == c.machineUserData) 1784 1777 && (strStateFile == c.strStateFile) 1785 1778 && (uuidCurrentSnapshot == c.uuidCurrentSnapshot) 1786 && (strSnapshotFolder == c.strSnapshotFolder)1787 && (fTeleporterEnabled == c.fTeleporterEnabled)1788 && (uTeleporterPort == c.uTeleporterPort)1789 && (strTeleporterAddress == c.strTeleporterAddress)1790 && (strTeleporterPassword == c.strTeleporterPassword)1791 && (fRTCUseUTC == c.fRTCUseUTC)1792 1779 // skip fCurrentStateModified! 1793 1780 && (RTTimeSpecIsEqual(&timeLastStateChange, &c.timeLastStateChange)) … … 2536 2523 { 2537 2524 Utf8Str strLocalOrUTC; 2538 fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC)2539 && strLocalOrUTC == "UTC";2525 machineUserData.fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC) 2526 && strLocalOrUTC == "UTC"; 2540 2527 } 2541 2528 else if ( (pelmHwChild->nameEquals("UART")) … … 3049 3036 Utf8Str strUUID; 3050 3037 if ( (elmMachine.getAttributeValue("uuid", strUUID)) 3051 && (elmMachine.getAttributeValue("name", strName))3038 && (elmMachine.getAttributeValue("name", machineUserData.strName)) 3052 3039 ) 3053 3040 { 3054 3041 parseUUID(uuid, strUUID); 3055 3042 3056 if (!elmMachine.getAttributeValue("nameSync", fNameSync)) 3057 fNameSync = true; 3043 elmMachine.getAttributeValue("nameSync", machineUserData.fNameSync); 3058 3044 3059 3045 Utf8Str str; 3060 elmMachine.getAttributeValue("Description", strDescription);3061 3062 elmMachine.getAttributeValue("OSType", strOsType);3046 elmMachine.getAttributeValue("Description", machineUserData.strDescription); 3047 3048 elmMachine.getAttributeValue("OSType", machineUserData.strOsType); 3063 3049 if (m->sv < SettingsVersion_v1_5) 3064 convertOldOSType_pre1_5( strOsType);3050 convertOldOSType_pre1_5(machineUserData.strOsType); 3065 3051 3066 3052 elmMachine.getAttributeValue("stateFile", strStateFile); 3067 3053 if (elmMachine.getAttributeValue("currentSnapshot", str)) 3068 3054 parseUUID(uuidCurrentSnapshot, str); 3069 elmMachine.getAttributeValue("snapshotFolder", strSnapshotFolder);3055 elmMachine.getAttributeValue("snapshotFolder", machineUserData.strSnapshotFolder); 3070 3056 if (!elmMachine.getAttributeValue("currentStateModified", fCurrentStateModified)) 3071 3057 fCurrentStateModified = true; … … 3103 3089 } 3104 3090 else if (pelmMachineChild->nameEquals("Description")) 3105 strDescription = pelmMachineChild->getValue();3091 machineUserData.strDescription = pelmMachineChild->getValue(); 3106 3092 else if (pelmMachineChild->nameEquals("Teleporter")) 3107 3093 { 3108 if (!pelmMachineChild->getAttributeValue("enabled", fTeleporterEnabled)) 3109 fTeleporterEnabled = false; 3110 if (!pelmMachineChild->getAttributeValue("port", uTeleporterPort)) 3111 uTeleporterPort = 0; 3112 if (!pelmMachineChild->getAttributeValue("address", strTeleporterAddress)) 3113 strTeleporterAddress = ""; 3114 if (!pelmMachineChild->getAttributeValue("password", strTeleporterPassword)) 3115 strTeleporterPassword = ""; 3094 pelmMachineChild->getAttributeValue("enabled", machineUserData.fTeleporterEnabled); 3095 pelmMachineChild->getAttributeValue("port", machineUserData.uTeleporterPort); 3096 pelmMachineChild->getAttributeValue("address", machineUserData.strTeleporterAddress); 3097 pelmMachineChild->getAttributeValue("password", machineUserData.strTeleporterPassword); 3116 3098 } 3117 3099 } … … 3574 3556 { 3575 3557 xml::ElementNode *pelmRTC = pelmHardware->createChild("RTC"); 3576 pelmRTC->setAttribute("localOrUTC", fRTCUseUTC ? "UTC" : "local");3558 pelmRTC->setAttribute("localOrUTC", machineUserData.fRTCUseUTC ? "UTC" : "local"); 3577 3559 } 3578 3560 … … 3782 3764 3783 3765 xml::ElementNode *pelmController = pelmStorageControllers->createChild("StorageController"); 3784 com::Utf8Str name = sc.strName.raw(); 3785 // 3766 com::Utf8Str name = sc.strName; 3786 3767 if (m->sv < SettingsVersion_v1_8) 3787 3768 { … … 3984 3965 3985 3966 elmMachine.setAttribute("uuid", uuid.toStringCurly()); 3986 elmMachine.setAttribute("name", strName);3987 if (! fNameSync)3988 elmMachine.setAttribute("nameSync", fNameSync);3989 if ( strDescription.length())3990 elmMachine.createChild("Description")->addContent( strDescription);3991 elmMachine.setAttribute("OSType", strOsType);3967 elmMachine.setAttribute("name", machineUserData.strName); 3968 if (!machineUserData.fNameSync) 3969 elmMachine.setAttribute("nameSync", machineUserData.fNameSync); 3970 if (machineUserData.strDescription.length()) 3971 elmMachine.createChild("Description")->addContent(machineUserData.strDescription); 3972 elmMachine.setAttribute("OSType", machineUserData.strOsType); 3992 3973 if (strStateFile.length()) 3993 3974 elmMachine.setAttribute("stateFile", strStateFile); … … 3995 3976 && !uuidCurrentSnapshot.isEmpty()) 3996 3977 elmMachine.setAttribute("currentSnapshot", uuidCurrentSnapshot.toStringCurly()); 3997 if ( strSnapshotFolder.length())3998 elmMachine.setAttribute("snapshotFolder", strSnapshotFolder);3978 if (machineUserData.strSnapshotFolder.length()) 3979 elmMachine.setAttribute("snapshotFolder", machineUserData.strSnapshotFolder); 3999 3980 if (!fCurrentStateModified) 4000 3981 elmMachine.setAttribute("currentStateModified", fCurrentStateModified); … … 4003 3984 elmMachine.setAttribute("aborted", fAborted); 4004 3985 if ( m->sv >= SettingsVersion_v1_9 4005 && ( fTeleporterEnabled4006 || uTeleporterPort4007 || ! strTeleporterAddress.isEmpty()4008 || ! strTeleporterPassword.isEmpty()3986 && ( machineUserData.fTeleporterEnabled 3987 || machineUserData.uTeleporterPort 3988 || !machineUserData.strTeleporterAddress.isEmpty() 3989 || !machineUserData.strTeleporterPassword.isEmpty() 4009 3990 ) 4010 3991 ) 4011 3992 { 4012 3993 xml::ElementNode *pelmTeleporter = elmMachine.createChild("Teleporter"); 4013 pelmTeleporter->setAttribute("enabled", fTeleporterEnabled);4014 pelmTeleporter->setAttribute("port", uTeleporterPort);4015 pelmTeleporter->setAttribute("address", strTeleporterAddress);4016 pelmTeleporter->setAttribute("password", strTeleporterPassword);3994 pelmTeleporter->setAttribute("enabled", machineUserData.fTeleporterEnabled); 3995 pelmTeleporter->setAttribute("port", machineUserData.uTeleporterPort); 3996 pelmTeleporter->setAttribute("address", machineUserData.strTeleporterAddress); 3997 pelmTeleporter->setAttribute("password", machineUserData.strTeleporterPassword); 4017 3998 } 4018 3999 … … 4244 4225 || (hardwareMachine.fPageFusionEnabled) 4245 4226 // and CPU hotplug, RTC timezone control, HID type and HPET 4246 || fRTCUseUTC4227 || machineUserData.fRTCUseUTC 4247 4228 || hardwareMachine.fCpuHotPlug 4248 4229 || hardwareMachine.pointingHidType != PointingHidType_PS2Mouse … … 4308 4289 && ( (hardwareMachine.firmwareType >= FirmwareType_EFI) 4309 4290 || (hardwareMachine.fHardwareVirtExclusive != HWVIRTEXCLUSIVEDEFAULT) 4310 || fTeleporterEnabled4311 || uTeleporterPort4312 || ! strTeleporterAddress.isEmpty()4313 || ! strTeleporterPassword.isEmpty()4291 || machineUserData.fTeleporterEnabled 4292 || machineUserData.uTeleporterPort 4293 || !machineUserData.strTeleporterAddress.isEmpty() 4294 || !machineUserData.strTeleporterPassword.isEmpty() 4314 4295 || !hardwareMachine.uuid.isEmpty() 4315 4296 )
Note:
See TracChangeset
for help on using the changeset viewer.