VirtualBox

Ignore:
Timestamp:
Feb 2, 2012 7:26:12 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: cache vboxGlobal().virtualBox().GetHost()

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r39800 r39968  
    1919#include <VBox/vd.h>
    2020#include <VBox/version.h>
    21 #include <stdio.h>
     21#include <iprt/stream.h>
    2222
    2323#include "VBoxUtils.h"
     
    283283    , mRecompileUser(false)
    284284    , mVerString("1.0")
    285     , m3DAvailable(-1)
     285    , m3DAvailable(false)
    286286{
    287287}
     
    393393}
    394394
    395 bool VBoxGlobal::is3DAvailable()
    396 {
    397     if (m3DAvailable < 0)
    398         m3DAvailable = virtualBox().GetHost().GetAcceleration3DAvailable();
    399     return m3DAvailable;
    400 }
    401 
    402395/**
    403396 *  Sets the new global settings and saves them to the VirtualBox server.
     
    16661659
    16671660        /* VT-x/AMD-V availability: */
    1668         bool fVTxAMDVSupported = virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
     1661        bool fVTxAMDVSupported = host().GetProcessorFeature(KProcessorFeature_HWVirtEx);
    16691662
    16701663        if (fVTxAMDVSupported)
     
    24132406    addNullMediumToList (mMediaList, mMediaList.end());
    24142407    addHardDisksToList (mVBox.GetHardDisks(), mMediaList, mMediaList.end());
    2415     addMediumsToList (mVBox.GetHost().GetDVDDrives(), mMediaList, mMediaList.end(), VBoxDefs::MediumType_DVD);
     2408    addMediumsToList (mHost.GetDVDDrives(), mMediaList, mMediaList.end(), VBoxDefs::MediumType_DVD);
    24162409    addMediumsToList (mVBox.GetDVDImages(), mMediaList, mMediaList.end(), VBoxDefs::MediumType_DVD);
    2417     addMediumsToList (mVBox.GetHost().GetFloppyDrives(), mMediaList, mMediaList.end(), VBoxDefs::MediumType_Floppy);
     2410    addMediumsToList (mHost.GetFloppyDrives(), mMediaList, mMediaList.end(), VBoxDefs::MediumType_Floppy);
    24182411    addMediumsToList (mVBox.GetFloppyImages(), mMediaList, mMediaList.end(), VBoxDefs::MediumType_Floppy);
    24192412
     
    48004793        return;
    48014794    }
     4795    mHost = virtualBox().GetHost();
     4796    m3DAvailable = mHost.GetAcceleration3DAvailable();
    48024797
    48034798    /* create default non-null global settings */
     
    54585453    mUSBDevicesMap.clear();
    54595454
    5460     CHost host = vboxGlobal().virtualBox().GetHost();
     5455    CHost host = vboxGlobal().host();
    54615456
    54625457    bool isUSBEmpty = host.GetUSBDevices().size() == 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r39872 r39968  
    135135
    136136    CVirtualBox virtualBox() const { return mVBox; }
     137    CHost host() const { return mHost; }
    137138
    138139    VBoxGlobalSettings &settings() { return gset; }
     
    150151    QWidget *mainWindow() const { return mMainWindow; }
    151152
    152     bool is3DAvailable();
     153    bool is3DAvailable() const { return m3DAvailable; }
    153154
    154155#ifdef VBOX_GUI_WITH_PIDFILE
     
    806807
    807808    CVirtualBox mVBox;
     809    CHost mHost;
    808810
    809811    VBoxGlobalSettings gset;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r39932 r39968  
    10771077            {
    10781078                case VBoxDefs::MediumType_DVD:
    1079                     mediums = vboxGlobal().virtualBox().GetHost().GetDVDDrives();
     1079                    mediums = vboxGlobal().host().GetDVDDrives();
    10801080                    strRecentMediumAddress = VBoxDefs::GUI_RecentListCD;
    10811081                    break;
    10821082                case VBoxDefs::MediumType_Floppy:
    1083                     mediums = vboxGlobal().virtualBox().GetHost().GetFloppyDrives();
     1083                    mediums = vboxGlobal().host().GetFloppyDrives();
    10841084                    strRecentMediumAddress = VBoxDefs::GUI_RecentListFD;
    10851085                    break;
     
    13661366
    13671367    /* Get current host: */
    1368     CHost host = vboxGlobal().virtualBox().GetHost();
     1368    CHost host = vboxGlobal().host();
    13691369
    13701370    /* Get host USB device list: */
     
    14351435        {
    14361436            /* Get current host: */
    1437             CHost host = vboxGlobal().virtualBox().GetHost();
     1437            CHost host = vboxGlobal().host();
    14381438            /* Search the host for the corresponding USB device: */
    14391439            CHostUSBDevice hostDevice = host.FindUSBDeviceById(target.id);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r39074 r39968  
    270270        bool fShouldWeClose;
    271271
    272         bool fVTxAMDVSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
     272        bool fVTxAMDVSupported = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx);
    273273
    274274        QApplication::processEvents();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp

    r39800 r39968  
    275275    /* Variables: */
    276276    CVirtualBox m_vbox;
     277    CHost m_host;
    277278    UIDetails *m_pUIDetails;
    278279    int m_iBlockNumber;
     
    625626    : QWidget(pParent)
    626627    , m_vbox(vboxGlobal().virtualBox())
     628    , m_host(vboxGlobal().host())
    627629    , m_pUIDetails(pParent)
    628630    , m_iBlockNumber(iBlockNumber)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r39779 r39968  
    533533#ifdef ENABLE_GLOBAL_USB
    534534            /* Get the host object: */
    535             CHost host = vboxGlobal().virtualBox().GetHost();
     535            CHost host = vboxGlobal().host();
    536536            /* Show the host error message if any: */
    537537            if (!host.isReallyOk())
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp

    r38311 r39968  
    252252
    253253    /* Load to cache: */
    254     const CHostNetworkInterfaceVector &interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
     254    const CHostNetworkInterfaceVector &interfaces = vboxGlobal().host().GetNetworkInterfaces();
    255255    for (int iNetworkIndex = 0; iNetworkIndex < interfaces.size(); ++iNetworkIndex)
    256256    {
     
    305305    /* Prepare useful variables: */
    306306    CVirtualBox vbox = vboxGlobal().virtualBox();
    307     CHost host = vbox.GetHost();
     307    CHost host = vboxGlobal().host();
    308308
    309309    /* Update all the host-only interfaces: */
     
    411411    /* Prepare useful variables: */
    412412    CVirtualBox vbox = vboxGlobal().virtualBox();
    413     CHost host = vbox.GetHost();
     413    CHost host = vboxGlobal().host();
    414414
    415415    /* Create new host-only interface: */
     
    457457    /* Prepare useful variables: */
    458458    CVirtualBox vbox = vboxGlobal().virtualBox();
    459     CHost host = vbox.GetHost();
     459    CHost host = vboxGlobal().host();
    460460
    461461    /* Find corresponding interface: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r37945 r39968  
    480480void UIMachineSettingsNetwork::sltGenerateMac()
    481481{
    482     m_pMACEditor->setText(vboxGlobal().virtualBox().GetHost().GenerateMACAddress());
     482    m_pMACEditor->setText(vboxGlobal().host().GenerateMACAddress());
    483483}
    484484
     
    10011001    /* Reload bridged interface list: */
    10021002    m_bridgedAdapterList.clear();
    1003     const CHostNetworkInterfaceVector &ifaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
     1003    const CHostNetworkInterfaceVector &ifaces = vboxGlobal().host().GetNetworkInterfaces();
    10041004    for (int i = 0; i < ifaces.size(); ++i)
    10051005    {
     
    10341034    /* Reload host-only interface list: */
    10351035    m_hostInterfaceList.clear();
    1036     const CHostNetworkInterfaceVector &ifaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
     1036    const CHostNetworkInterfaceVector &ifaces = vboxGlobal().host().GetNetworkInterfaces();
    10371037    for (int i = 0; i < ifaces.size(); ++i)
    10381038    {
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r37753 r39968  
    3939    /* Setup constants */
    4040    CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties();
    41     uint hostCPUs = vboxGlobal().virtualBox().GetHost().GetProcessorCount();
     41    uint hostCPUs = vboxGlobal().host().GetProcessorCount();
    4242    mMinGuestCPU = properties.GetMinGuestCPUCount();
    4343    mMaxGuestCPU = RT_MIN (2 * hostCPUs, properties.GetMaxGuestCPUCount());
     
    227227    }
    228228    /* Gather other system data: */
    229     systemData.m_fPFHwVirtExSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
    230     systemData.m_fPFPAESupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_PAE);
     229    systemData.m_fPFHwVirtExSupported = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx);
     230    systemData.m_fPFPAESupported = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_PAE);
    231231    systemData.m_fIoApicEnabled = m_machine.GetBIOSSettings().GetIOAPICEnabled();
    232232    systemData.m_fEFIEnabled = m_machine.GetFirmwareType() >= KFirmwareType_EFI && m_machine.GetFirmwareType() <= KFirmwareType_EFIDUAL;
     
    387387bool UIMachineSettingsSystem::revalidate (QString &aWarning, QString & /* aTitle */)
    388388{
    389     ulong fullSize = vboxGlobal().virtualBox().GetHost().GetMemorySize();
     389    ulong fullSize = vboxGlobal().host().GetMemorySize();
    390390    if (mSlMemory->value() > (int)mSlMemory->maxRAMAlw())
    391391    {
     
    410410
    411411    /* VCPU amount test */
    412     int totalCPUs = vboxGlobal().virtualBox().GetHost().GetProcessorOnlineCount();
     412    int totalCPUs = vboxGlobal().host().GetProcessorOnlineCount();
    413413    if (mSlCPU->value() > 2 * totalCPUs)
    414414    {
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp

    r38913 r39968  
    155155        {
    156156            /* For each USB filter: */
    157             const CHostUSBDeviceFilterVector &filters = vboxGlobal().virtualBox().GetHost().GetUSBDeviceFilters();
     157            const CHostUSBDeviceFilterVector &filters = vboxGlobal().host().GetUSBDeviceFilters();
    158158            for (int iFilterIndex = 0; iFilterIndex < filters.size(); ++iFilterIndex)
    159159            {
     
    350350                {
    351351                    /* Get host: */
    352                     CHost host = vboxGlobal().virtualBox().GetHost();
     352                    CHost host = vboxGlobal().host();
    353353                    /* For each USB filter data set: */
    354354                    for (int iFilterIndex = 0; iFilterIndex < m_cache.childCount(); ++iFilterIndex)
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxGuestRAMSlider.cpp

    r28800 r39968  
    6464void VBoxGuestRAMSlider::init()
    6565{
    66     ulong fullSize = vboxGlobal().virtualBox().GetHost().GetMemorySize();
     66    ulong fullSize = vboxGlobal().host().GetMemorySize();
    6767    CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
    6868    mMinRAM = sys.GetMinGuestRAM();
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorWidget.cpp

    r33781 r39968  
    5454
    5555    /* Check if host supports (AMD-V or VT-x) and long mode */
    56     CHost host = vboxGlobal().virtualBox().GetHost();
     56    CHost host = vboxGlobal().host();
    5757    m_fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
    5858    m_fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
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