VirtualBox

Changeset 45167 in vbox


Ignore:
Timestamp:
Mar 25, 2013 12:41:25 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Little cleanup related to main machine-window accessibility stuff.

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

Legend:

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

    r45121 r45167  
    472472QWidget* VBoxGlobal::vmWindow()
    473473{
    474     if (isVMConsoleProcess() && m_pVirtualMachine)
    475         return m_pVirtualMachine->mainWindow();
    476     return 0;
     474    /* Null if that is NOT console-process or machine not yet created: */
     475    if (!isVMConsoleProcess() || !m_pVirtualMachine)
     476        return 0;
     477    /* Main machine-window otherwise: */
     478    return m_pVirtualMachine->mainWindow();
    477479}
    478480
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r44823 r45167  
    417417QWidget* UIMachine::mainWindow() const
    418418{
    419     if (machineLogic() && machineLogic()->mainMachineWindow())
    420         return machineLogic()->mainMachineWindow();
    421     else
     419    /* Null if machine-logic not yet created: */
     420    if (!machineLogic())
    422421        return 0;
     422    /* Main machine-window otherwise: */
     423    return machineLogic()->mainMachineWindow();
    423424}
    424425
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r45079 r45167  
    235235UIMachineWindow* UIMachineLogic::mainMachineWindow() const
    236236{
    237     /* Return null if windows are not created yet: */
     237    /* Null if machine-window(s) not yet created: */
    238238    if (!isMachineWindowsCreated())
    239239        return 0;
    240 
    241     /* Otherwise return first of windows: */
    242     return machineWindows()[0];
     240    /* First machine-window otherwise: */
     241    return machineWindows().first();
    243242}
    244243
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