summaryrefslogtreecommitdiff
path: root/src/VBox/Main/xml/Settings.cpp
diff options
context:
space:
mode:
authorFelix Geyer <fgeyer@debian.org>2013-03-02 22:29:33 +0100
committerFelix Geyer <fgeyer@debian.org>2013-03-02 22:29:33 +0100
commitfb32dd2be67519662e93ffbbe520c79d95b1fbfb (patch)
treee445911bff35c842af26b5e5c0ee31573be49008 /src/VBox/Main/xml/Settings.cpp
parent490244144bf10ecd165f2f81f2c88b7781c91d85 (diff)
downloadvirtualbox-upstream/4.2.8-dfsg.tar.gz
Imported Upstream version 4.2.8-dfsgupstream/4.2.8-dfsg
Diffstat (limited to 'src/VBox/Main/xml/Settings.cpp')
-rw-r--r--src/VBox/Main/xml/Settings.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/VBox/Main/xml/Settings.cpp b/src/VBox/Main/xml/Settings.cpp
index 8cb1e1269..97375c6e0 100644
--- a/src/VBox/Main/xml/Settings.cpp
+++ b/src/VBox/Main/xml/Settings.cpp
@@ -54,7 +54,7 @@
*/
/*
- * Copyright (C) 2007-2012 Oracle Corporation
+ * Copyright (C) 2007-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -1614,6 +1614,7 @@ Hardware::Hardware()
pointingHIDType(PointingHIDType_PS2Mouse),
keyboardHIDType(KeyboardHIDType_PS2Keyboard),
chipsetType(ChipsetType_PIIX3),
+ fEmulatedUSBWebcam(false),
fEmulatedUSBCardReader(false),
clipboardMode(ClipboardMode_Disabled),
dragAndDropMode(DragAndDropMode_Disabled),
@@ -1682,6 +1683,7 @@ bool Hardware::operator==(const Hardware& h) const
&& (pointingHIDType == h.pointingHIDType)
&& (keyboardHIDType == h.keyboardHIDType)
&& (chipsetType == h.chipsetType)
+ && (fEmulatedUSBWebcam == h.fEmulatedUSBWebcam)
&& (fEmulatedUSBCardReader == h.fEmulatedUSBCardReader)
&& (vrdeSettings == h.vrdeSettings)
&& (biosSettings == h.biosSettings)
@@ -2870,12 +2872,17 @@ void MachineConfigFile::readHardware(const xml::ElementNode &elmHardware,
}
else if (pelmHwChild->nameEquals("EmulatedUSB"))
{
- const xml::ElementNode *pelmCardReader;
+ const xml::ElementNode *pelmCardReader, *pelmWebcam;
if ((pelmCardReader = pelmHwChild->findChildElement("CardReader")))
{
pelmCardReader->getAttributeValue("enabled", hw.fEmulatedUSBCardReader);
}
+
+ if ((pelmWebcam = pelmHwChild->findChildElement("Webcam")))
+ {
+ pelmWebcam->getAttributeValue("enabled", hw.fEmulatedUSBWebcam);
+ }
}
}
@@ -4181,9 +4188,15 @@ void MachineConfigFile::buildHardwareXML(xml::ElementNode &elmParent,
if (m->sv >= SettingsVersion_v1_12)
{
xml::ElementNode *pelmEmulatedUSB = pelmHardware->createChild("EmulatedUSB");
- xml::ElementNode *pelmCardReader = pelmEmulatedUSB->createChild("CardReader");
+ xml::ElementNode *pelmCardReader = pelmEmulatedUSB->createChild("CardReader");
pelmCardReader->setAttribute("enabled", hw.fEmulatedUSBCardReader);
+
+ if (m->sv >= SettingsVersion_v1_13)
+ {
+ xml::ElementNode *pelmWebcam = pelmEmulatedUSB->createChild("Webcam");
+ pelmWebcam->setAttribute("enabled", hw.fEmulatedUSBWebcam);
+ }
}
xml::ElementNode *pelmGuest = pelmHardware->createChild("Guest");
@@ -4870,6 +4883,13 @@ void MachineConfigFile::bumpSettingsVersionIfNeeded()
}
}
+ if (m->sv < SettingsVersion_v1_13)
+ {
+ /* 4.2: Emulated USB Webcam. */
+ if (hardwareMachine.fEmulatedUSBWebcam)
+ m->sv = SettingsVersion_v1_13;
+ }
+
if (m->sv < SettingsVersion_v1_12)
{
// 4.1: Emulated USB devices.