VirtualBox

Changeset 57805 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Sep 17, 2015 3:01:21 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102750
Message:

FE/Qt: Small cleanup related to UIMachine.

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

Legend:

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

    r57611 r57805  
    456456
    457457    return *mSelectorWnd;
    458 }
    459 
    460 UIMachine* VBoxGlobal::virtualMachine() const
    461 {
    462     return gpMachine;
    463458}
    464459
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r57611 r57805  
    177177    UISelectorWindow &selectorWnd();
    178178
    179     /** Returns current virtual machine. */
    180     UIMachine* virtualMachine() const;
    181179    /** Returns currently active virtual machine window. */
    182180    QWidget* activeMachineWindow() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r57179 r57805  
    4545bool UIMachine::startMachine(const QString &strID)
    4646{
    47     /* Some restrictions: */
    48     AssertMsgReturn(vboxGlobal().isValid(), ("VBoxGlobal is invalid.."), false);
    49     AssertMsgReturn(!vboxGlobal().virtualMachine(), ("Machine already started.."), false);
     47    /* Make sure machine is not created: */
     48    AssertReturn(!m_spInstance, false);
    5049
    5150    /* Restore current snapshot if requested: */
     
    9897bool UIMachine::create()
    9998{
    100     /* Make sure machine is null pointer: */
    101     AssertReturn(m_spInstance == 0, false);
     99    /* Make sure machine is not created: */
     100    AssertReturn(!m_spInstance, false);
    102101
    103102    /* Create machine UI: */
     
    118117void UIMachine::destroy()
    119118{
    120     /* Make sure machine is valid pointer: */
    121     AssertReturnVoid(m_spInstance != 0);
     119    /* Make sure machine is created: */
     120    AssertPtrReturnVoid(m_spInstance);
    122121
    123122    /* Cleanup machine UI: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r57591 r57805  
    19831983static void signalHandlerSIGUSR1(int sig, siginfo_t * /* pInfo */, void * /*pSecret */)
    19841984{
    1985     /* only SIGUSR1 is interesting */
     1985    /* Only SIGUSR1 is interesting: */
    19861986    if (sig == SIGUSR1)
    1987         if (UIMachine *pMachine = vboxGlobal().virtualMachine())
    1988             pMachine->uisession()->machineLogic()->keyboardHandler()->releaseAllPressedKeys();
     1987        if (gpMachine)
     1988            gpMachine->uisession()->machineLogic()->keyboardHandler()->releaseAllPressedKeys();
    19891989}
    19901990#endif /* VBOX_GUI_WITH_KEYS_RESET_HANDLER */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette