VirtualBox

Ignore:
Timestamp:
Apr 29, 2015 2:33:39 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99882
Message:

Main: extend IVetoEvent interface to support approvals too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/EventImpl.cpp

    r53160 r55523  
    228228
    229229typedef std::list<Utf8Str> VetoList;
     230typedef std::list<Utf8Str> ApprovalList;
    230231struct VBoxVetoEvent::Data
    231232{
     
    236237    BOOL                    mVetoed;
    237238    VetoList                mVetoList;
     239    ApprovalList            mApprovalList;
    238240};
    239241
     
    272274    m->mVetoed = FALSE;
    273275    m->mVetoList.clear();
     276    m->mApprovalList.clear();
    274277
    275278    /* Confirm a successful initialization */
     
    350353    return S_OK;
    351354
     355}
     356
     357HRESULT VBoxVetoEvent::addApproval(const com::Utf8Str &aReason)
     358{
     359    // AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     360    m->mApprovalList.push_back(aReason);
     361    return S_OK;
     362}
     363
     364HRESULT VBoxVetoEvent::isApproved(BOOL *aResult)
     365{
     366    // AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     367    *aResult = !m->mApprovalList.empty();
     368    return S_OK;
     369}
     370
     371HRESULT VBoxVetoEvent::getApprovals(std::vector<com::Utf8Str> &aResult)
     372{
     373    // AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     374    aResult.resize(m->mApprovalList.size());
     375    size_t i = 0;
     376    for (ApprovalList::const_iterator it = m->mApprovalList.begin(); it != m->mApprovalList.end(); ++it, ++i)
     377        aResult[i] = (*it);
     378    return S_OK;
    352379}
    353380
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