本文整理汇总了C++中CGuestOSType::GetIs64Bit方法的典型用法代码示例。如果您正苦于以下问题:C++ CGuestOSType::GetIs64Bit方法的具体用法?C++ CGuestOSType::GetIs64Bit怎么用?C++ CGuestOSType::GetIs64Bit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGuestOSType
的用法示例。
在下文中一共展示了CGuestOSType::GetIs64Bit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveFromCacheTo
/* Save data from cache to corresponding external object(s),
* this task COULD be performed in other than GUI thread: */
void UIMachineSettingsGeneral::saveFromCacheTo(QVariant &data)
{
/* Fetch data to machine: */
UISettingsPageMachine::fetchData(data);
/* Check if general data was changed: */
if (m_cache.wasChanged())
{
/* Get general data from cache: */
const UIDataSettingsMachineGeneral &generalData = m_cache.data();
/* Store general data: */
if (isMachineInValidMode())
{
/* Advanced tab: */
m_machine.SetClipboardMode(generalData.m_clipboardMode);
m_machine.SetDragAndDropMode(generalData.m_dragAndDropMode);
m_machine.SetExtraData(GUI_SaveMountedAtRuntime, generalData.m_fSaveMountedAtRuntime ? "yes" : "no");
m_machine.SetExtraData(GUI_ShowMiniToolBar, generalData.m_fShowMiniToolBar ? "yes" : "no");
m_machine.SetExtraData(GUI_MiniToolBarAlignment, generalData.m_fMiniToolBarAtTop ? "top" : "bottom");
/* Description tab: */
m_machine.SetDescription(generalData.m_strDescription);
}
if (isMachineOffline())
{
/* Basic tab: Must update long mode CPU feature bit when os type changes. */
if (generalData.m_strGuestOsTypeId != m_cache.base().m_strGuestOsTypeId)
{
m_machine.SetOSTypeId(generalData.m_strGuestOsTypeId);
CVirtualBox vbox = vboxGlobal().virtualBox();
CGuestOSType newType = vbox.GetGuestOSType(generalData.m_strGuestOsTypeId);
m_machine.SetCPUProperty(KCPUPropertyType_LongMode, newType.GetIs64Bit());
}
/* Advanced tab: */
m_machine.SetSnapshotFolder(generalData.m_strSnapshotsFolder);
/* Basic (again) tab: */
/* VM name must be last as otherwise its VM rename magic can collide with other settings in the config,
* especially with the snapshot folder: */
m_machine.SetName(generalData.m_strName);
}
}
/* Upload machine to data: */
UISettingsPageMachine::uploadData(data);
}
示例2: saveFromCacheTo
void UIMachineSettingsGeneral::saveFromCacheTo(QVariant &data)
{
/* Fetch data to machine: */
UISettingsPageMachine::fetchData(data);
/* Check if general data was changed: */
if (m_cache.wasChanged())
{
/* Get general data from cache: */
const UIDataSettingsMachineGeneral &generalData = m_cache.data();
if (isMachineInValidMode())
{
/* 'Advanced' tab data: */
if (generalData.m_clipboardMode != m_cache.base().m_clipboardMode)
m_machine.SetClipboardMode(generalData.m_clipboardMode);
if (generalData.m_dndMode != m_cache.base().m_dndMode)
m_machine.SetDnDMode(generalData.m_dndMode);
/* 'Description' tab: */
if (generalData.m_strDescription != m_cache.base().m_strDescription)
m_machine.SetDescription(generalData.m_strDescription);
}
if (isMachineOffline())
{
/* 'Basic' tab data: Must update long mode CPU feature bit when os type changes. */
if (generalData.m_strGuestOsTypeId != m_cache.base().m_strGuestOsTypeId)
{
m_machine.SetOSTypeId(generalData.m_strGuestOsTypeId);
CVirtualBox vbox = vboxGlobal().virtualBox();
CGuestOSType newType = vbox.GetGuestOSType(generalData.m_strGuestOsTypeId);
m_machine.SetCPUProperty(KCPUPropertyType_LongMode, newType.GetIs64Bit());
}
/* 'Advanced' tab data: */
if (generalData.m_strSnapshotsFolder != m_cache.base().m_strSnapshotsFolder)
m_machine.SetSnapshotFolder(generalData.m_strSnapshotsFolder);
/* 'Basic' (again) tab data: */
/* VM name must be last as otherwise its VM rename magic
* can collide with other settings in the config,
* especially with the snapshot folder: */
if (generalData.m_strName != m_cache.base().m_strName)
m_machine.SetName(generalData.m_strName);
/* Encryption tab data: */
if (generalData.m_fEncryptionEnabled != m_cache.base().m_fEncryptionEnabled ||
generalData.m_fEncryptionCipherChanged != m_cache.base().m_fEncryptionCipherChanged ||
generalData.m_fEncryptionPasswordChanged != m_cache.base().m_fEncryptionPasswordChanged)
{
/* Cipher attribute changed? */
QString strNewCipher;
if (generalData.m_fEncryptionCipherChanged)
{
strNewCipher = generalData.m_fEncryptionEnabled ?
m_encryptionCiphers.at(generalData.m_iEncryptionCipherIndex) : QString();
}
/* Password attribute changed? */
QString strNewPassword;
QString strNewPasswordId;
if (generalData.m_fEncryptionPasswordChanged)
{
strNewPassword = generalData.m_fEncryptionEnabled ?
generalData.m_strEncryptionPassword : QString();
strNewPasswordId = generalData.m_fEncryptionEnabled ?
m_machine.GetName() : QString();
}
/* Get the maps of encrypted mediums and their passwords: */
const EncryptedMediumMap &encryptedMedium = generalData.m_encryptedMediums;
const EncryptionPasswordMap &encryptionPasswords = generalData.m_encryptionPasswords;
/* Enumerate attachments: */
foreach (const CMediumAttachment &attachment, m_machine.GetMediumAttachments())
{
/* Enumerate hard-drives only: */
if (attachment.GetType() == KDeviceType_HardDisk)
{
/* Get corresponding medium: */
CMedium medium = attachment.GetMedium();
/* Check if old password exists/provided: */
QString strOldPasswordId = encryptedMedium.key(medium.GetId());
QString strOldPassword = encryptionPasswords.value(strOldPasswordId);
/* Update encryption: */
CProgress cprogress = medium.ChangeEncryption(strOldPassword,
strNewCipher,
strNewPassword,
strNewPasswordId);
if (!medium.isOk())
{
QMetaObject::invokeMethod(this, "sigOperationProgressError", Qt::BlockingQueuedConnection,
Q_ARG(QString, UIMessageCenter::formatErrorInfo(medium)));
continue;
}
UIProgress uiprogress(cprogress);
connect(&uiprogress, SIGNAL(sigProgressChange(ulong, QString, ulong, ulong)),
this, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong)),
Qt::QueuedConnection);
//.........这里部分代码省略.........