VirtualBox

Ignore:
Timestamp:
Aug 10, 2010 3:40:18 PM (14 years ago)
Author:
vboxsync
Message:

Main: use settings struct for machine user data; remove iprt::MiniString::raw() and change all occurences to c_str()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r30856 r31539  
    5959struct USBController::Data
    6060{
    61     Data()
    62         : pParent(NULL)
    63     {};
     61    Data(Machine *pMachine)
     62        : pParent(pMachine),
     63          pHost(pMachine->getVirtualBox()->host())
     64    { }
    6465
    6566    ~Data()
    6667    {};
    6768
    68     /** Parent object. */
    6969    Machine * const                 pParent;
    70     /** Peer object. */
     70    Host * const                    pHost;
     71
     72    // peer machine's USB controller
    7173    const ComObjPtr<USBController>  pPeer;
    7274
     
    115117    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    116118
    117     m = new Data();
    118 
    119     unconst(m->pParent) = aParent;
     119    m = new Data(aParent);
     120
    120121    /* mPeer is left null */
    121122
     
    153154    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    154155
    155     m = new Data();
    156 
    157     unconst(m->pParent) = aParent;
     156    m = new Data(aParent);
     157
    158158    unconst(m->pPeer) = aPeer;
    159159
     
    197197    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    198198
    199     m = new Data();
    200 
    201     unconst(m->pParent) = aParent;
     199    m = new Data(aParent);
     200
    202201    /* mPeer is left null */
    203202
     
    537536    if (filter->getData().mActive && Global::IsOnline(adep.machineState()))
    538537    {
    539         USBProxyService *service = m->pParent->getVirtualBox()->host()->usbProxyService();
     538        USBProxyService *service = m->pHost->usbProxyService();
    540539        ComAssertRet(service, E_FAIL);
    541540
     
    608607    if (filter->getData().mActive && Global::IsOnline(adep.machineState()))
    609608    {
    610         USBProxyService *service = m->pParent->getVirtualBox()->host()->usbProxyService();
     609        USBProxyService *service = m->pHost->usbProxyService();
    611610        ComAssertRet(service, E_FAIL);
    612611
     
    756755    if (m->llDeviceFilters.isBackedUp())
    757756    {
    758         USBProxyService *service = m->pParent->getVirtualBox()->host()->usbProxyService();
     757        USBProxyService *service = m->pHost->usbProxyService();
    759758        Assert(service);
    760759
     
    10071006    /* we don't modify our data fields -- no need to lock */
    10081007
    1009     if (aFilter->mInList && m->pParent->isRegistered())
    1010     {
    1011         USBProxyService *service = m->pParent->getVirtualBox()->host()->usbProxyService();
     1008    if (    aFilter->mInList
     1009         && m->pParent->isRegistered())
     1010    {
     1011        USBProxyService *service = m->pHost->usbProxyService();
    10121012        ComAssertRet(service, E_FAIL);
    10131013
     
    12011201    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    12021202
    1203     USBProxyService *service = m->pParent->getVirtualBox()->host()->usbProxyService();
     1203    USBProxyService *service = m->pHost->usbProxyService();
    12041204    AssertReturn(service, E_FAIL);
    12051205
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