VirtualBox

Changeset 98963 in vbox


Ignore:
Timestamp:
Mar 14, 2023 2:36:10 PM (23 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: A bunch of sanity fixes for various UISession getters which can be used at startup if COM init or VM startup were failed; There will be more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98952 r98963  
    303303{
    304304    CMachine comMachine = machine();
     305    if (comMachine.isNull())
     306        return false;
    305307    const KChipsetType enmChipsetType = comMachine.GetChipsetType();
    306308    const bool fSuccess = comMachine.isOk();
     
    315317{
    316318    CMachine comMachine = machine();
     319    if (comMachine.isNull())
     320        return false;
    317321    const KMachineState enmMachineState = comMachine.GetState();
    318322    const bool fSuccess = comMachine.isOk();
     
    433437{
    434438    CKeyboard comKeyboard = keyboard();
     439    if (comKeyboard.isNull())
     440        return false;
    435441    comKeyboard.PutScancodes(codes);
    436442    const bool fSuccess = comKeyboard.isOk();
     
    473479{
    474480    CMouse comMouse = mouse();
     481    if (comMouse.isNull())
     482        return false;
    475483    const BOOL fAbsoluteSupported = comMouse.GetAbsoluteSupported();
    476484    const bool fSuccess = comMouse.isOk();
     
    485493{
    486494    CMouse comMouse = mouse();
     495    if (comMouse.isNull())
     496        return false;
    487497    const BOOL fRelativeSupported = comMouse.GetRelativeSupported();
    488498    const bool fSuccess = comMouse.isOk();
     
    497507{
    498508    CMouse comMouse = mouse();
     509    if (comMouse.isNull())
     510        return false;
    499511    const BOOL fTouchScreenSupported = comMouse.GetTouchScreenSupported();
    500512    const bool fSuccess = comMouse.isOk();
     
    509521{
    510522    CMouse comMouse = mouse();
     523    if (comMouse.isNull())
     524        return false;
    511525    const BOOL fTouchPadSupported = comMouse.GetTouchPadSupported();
    512526    const bool fSuccess = comMouse.isOk();
     
    521535{
    522536    CMouse comMouse = mouse();
     537    if (comMouse.isNull())
     538        return false;
    523539    const BOOL fNeedsHostCursor = comMouse.GetNeedsHostCursor();
    524540    const bool fSuccess = comMouse.isOk();
     
    533549{
    534550    CMouse comMouse = mouse();
     551    if (comMouse.isNull())
     552        return false;
    535553    comMouse.PutMouseEvent(iDx, iDy, iDz, iDw, iButtonState);
    536554    const bool fSuccess = comMouse.isOk();
     
    543561{
    544562    CMouse comMouse = mouse();
     563    if (comMouse.isNull())
     564        return false;
    545565    comMouse.PutMouseEventAbsolute(iX, iY, iDz, iDw, iButtonState);
    546566    const bool fSuccess = comMouse.isOk();
     
    553573{
    554574    CMouse comMouse = mouse();
     575    if (comMouse.isNull())
     576        return false;
    555577    comMouse.PutEventMultiTouch(iCount, contacts, fIsTouchScreen, uScanTime);
    556578    const bool fSuccess = comMouse.isOk();
     
    563585{
    564586    CMachine comMachine = machine();
     587    if (comMachine.isNull())
     588        return false;
    565589    const KClipboardMode enmClipboardMode = comMachine.GetClipboardMode();
    566590    const bool fSuccess = comMachine.isOk();
     
    585609{
    586610    CMachine comMachine = machine();
     611    if (comMachine.isNull())
     612        return false;
    587613    const KDnDMode enmDnDMode = comMachine.GetDnDMode();
    588614    const bool fSuccess = comMachine.isOk();
     
    607633{
    608634    const CMachine comMachine = machine();
     635    if (comMachine.isNull())
     636        return false;
    609637    ulong cActualHardDisks = 0, cActualOpticalDrives = 0, cActualFloppyDrives = 0;
    610638    const CMediumAttachmentVector comAttachments = comMachine.GetMediumAttachments();
     
    963991    /* Check whether USB device filters are available: */
    964992    CMachine comMachine = machine();
     993    if (comMachine.isNull())
     994        return;
    965995    CUSBDeviceFilters comUSBDeviceFilters = comMachine.GetUSBDeviceFilters();
    966996    if (!comMachine.isOk() || comUSBDeviceFilters.isNull())
     
    9891019    /* Check whether USB controllers are available: */
    9901020    CMachine comMachine = machine();
     1021    if (comMachine.isNull())
     1022        return;
    9911023    CUSBControllerVector comUSBControllers = comMachine.GetUSBControllers();
    9921024    if (!comMachine.isOk() || comUSBControllers.isEmpty())
     
    13231355{
    13241356    CMachine comMachine = machine();
     1357    if (comMachine.isNull())
     1358        return false;
    13251359    CAudioSettings comSettings = comMachine.GetAudioSettings();
    13261360    const bool fSuccess = comMachine.isOk();
     
    15331567
    15341568    CMachine comMachine = machine();
     1569    if (comMachine.isNull())
     1570        return false;
    15351571    CGraphicsAdapter comAdapter = comMachine.GetGraphicsAdapter();
    15361572    bool fSuccess = comMachine.isOk();
     
    17351771{
    17361772    CDisplay comDisplay = display();
     1773    if (comDisplay.isNull())
     1774        return false;
    17371775    comDisplay.ViewportChanged(uScreenId, xOrigin, yOrigin, uWidth, uHeight);
    17381776    const bool fSuccess = comDisplay.isOk();
     
    17651803{
    17661804    CMachine comMachine = machine();
     1805    if (comMachine.isNull())
     1806        return false;
    17671807    CVRDEServer comServer = comMachine.GetVRDEServer();
    17681808    fPresent = comMachine.isOk() && comServer.isNotNull();
     
    18841924{
    18851925    CMachine comMachine = machine();
     1926    if (comMachine.isNull())
     1927        return;
    18861928    UIDetailsGenerator::acquireHardDiskStatusInfo(comMachine, strInfo, fAttachmentsPresent);
    18871929}
     
    18901932{
    18911933    CMachine comMachine = machine();
     1934    if (comMachine.isNull())
     1935        return;
    18921936    UIDetailsGenerator::acquireOpticalDiskStatusInfo(comMachine, strInfo, fAttachmentsPresent, fAttachmentsMounted);
    18931937}
     
    18961940{
    18971941    CMachine comMachine = machine();
     1942    if (comMachine.isNull())
     1943        return;
    18981944    UIDetailsGenerator::acquireFloppyDiskStatusInfo(comMachine, strInfo, fAttachmentsPresent, fAttachmentsMounted);
    18991945}
     
    19021948{
    19031949    CMachine comMachine = machine();
     1950    if (comMachine.isNull())
     1951        return;
    19041952    UIDetailsGenerator::acquireAudioStatusInfo(comMachine, strInfo, fAudioEnabled, fEnabledOutput, fEnabledInput);
    19051953}
     
    19081956{
    19091957    CMachine comMachine = machine();
     1958    if (comMachine.isNull())
     1959        return;
    19101960    UIDetailsGenerator::acquireNetworkStatusInfo(comMachine, strInfo, fAdaptersPresent, fCablesDisconnected);
    19111961}
     
    19141964{
    19151965    CMachine comMachine = machine();
     1966    if (comMachine.isNull())
     1967        return;
    19161968    CConsole comConsole = console();
     1969    if (comConsole.isNull())
     1970        return;
    19171971    UIDetailsGenerator::acquireUsbStatusInfo(comMachine, comConsole, strInfo, fUsbEnableds);
    19181972}
     
    19211975{
    19221976    CMachine comMachine = machine();
     1977    if (comMachine.isNull())
     1978        return;
    19231979    CConsole comConsole = console();
     1980    if (comConsole.isNull())
     1981        return;
    19241982    CGuest comGuest = guest();
     1983    if (comGuest.isNull())
     1984        return;
    19251985    UIDetailsGenerator::acquireSharedFoldersStatusInfo(comMachine, comConsole, comGuest, strInfo, fFoldersPresent);
    19261986}
     
    19291989{
    19301990    CMachine comMachine = machine();
     1991    if (comMachine.isNull())
     1992        return;
    19311993    UIDetailsGenerator::acquireDisplayStatusInfo(comMachine, strInfo, fAcceleration3D);
    19321994}
     
    19351997{
    19361998    CMachine comMachine = machine();
     1999    if (comMachine.isNull())
     2000        return;
    19372001    fMachinePaused = isPaused();
    19382002    UIDetailsGenerator::acquireRecordingStatusInfo(comMachine, strInfo, fRecordingEnabled);
     
    19442008{
    19452009    CMachine comMachine = machine();
     2010    if (comMachine.isNull())
     2011        return;
    19462012    UIDetailsGenerator::acquireFeaturesStatusInfo(comMachine, strInfo,
    19472013                                                  enmEngine,
     
    20252091{
    20262092    CMachineDebugger comDebugger = debugger();
     2093    if (comDebugger.isNull())
     2094        return false;
    20272095    const BOOL fLogEnabled = comDebugger.GetLogEnabled();
    20282096    const bool fSuccess = comDebugger.isOk();
     
    20492117{
    20502118    CMachine comMachine = machine();
     2119    if (comMachine.isNull())
     2120        return false;
    20512121    const KParavirtProvider enmParavirtProvider = comMachine.GetEffectiveParavirtProvider();
    20522122    const bool fSuccess = comMachine.isOk();
     
    20612131{
    20622132    CMachineDebugger comDebugger = debugger();
     2133    if (comDebugger.isNull())
     2134        return false;
    20632135    const KVMExecutionEngine enmEngineType = comDebugger.GetExecutionEngine();
    20642136    const bool fSuccess = comDebugger.isOk();
     
    20732145{
    20742146    CMachineDebugger comDebugger = debugger();
     2147    if (comDebugger.isNull())
     2148        return false;
    20752149    const BOOL fFeatureEnabled = comDebugger.GetHWVirtExNestedPagingEnabled();
    20762150    const bool fSuccess = comDebugger.isOk();
     
    20852159{
    20862160    CMachineDebugger comDebugger = debugger();
     2161    if (comDebugger.isNull())
     2162        return false;
    20872163    const BOOL fFeatureEnabled = comDebugger.GetHWVirtExUXEnabled();
    20882164    const bool fSuccess = comDebugger.isOk();
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