VirtualBox

Changeset 67242 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 2, 2017 3:09:35 PM (8 years ago)
Author:
vboxsync
Message:

Main/ProgresImpl: Added a callback method for VD as well (i_vdProgressCallback). Identical to the IPRT one, except the parameters are switched around.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ProgressImpl.h

    r67230 r67242  
    141141    bool i_setCancelCallback(void (*pfnCallback)(void *), void *pvUser);
    142142
    143     static DECLCALLBACK(int) i_iprtProgressCallback(unsigned uPrecentage, void *pvUser);
     143    static DECLCALLBACK(int) i_iprtProgressCallback(unsigned uPercentage, void *pvUser);
     144    static DECLCALLBACK(int) Progress::i_vdProgressCallback(void *pvUser, unsigned uPercentage);
    144145
    145146protected:
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r67230 r67242  
    538538
    539539/**
    540  * @callback_method_impl{FNRTPROGRESS, }
    541  */
    542 /*static*/ DECLCALLBACK(int) Progress::i_iprtProgressCallback(unsigned uPrecentage, void *pvUser)
     540 * @callback_method_impl{FNRTPROGRESS,
     541 *      Works the progress of the current operation.}
     542 */
     543/*static*/ DECLCALLBACK(int) Progress::i_iprtProgressCallback(unsigned uPercentage, void *pvUser)
    543544{
    544545    Progress *pThis = (Progress *)pvUser;
     
    553554        pThis->i_checkForAutomaticTimeout();
    554555        if (!pThis->mCanceled)
    555             pThis->m_ulOperationPercent = RT_MIN(uPrecentage, 100);
     556        {
     557            if (uPercentage > pThis->m_ulOperationPercent)
     558                pThis->m_ulOperationPercent = RT_MIN(uPercentage, 100);
     559        }
    556560        else
    557561        {
     
    564568}
    565569
     570/**
     571 * @callback_method_impl{FNVDPROGRESS,
     572 *      Progress::i_iprtProgressCallback with parameters switched around.}
     573 */
     574/*static*/ DECLCALLBACK(int) Progress::i_vdProgressCallback(void *pvUser, unsigned uPercentage)
     575{
     576    return i_iprtProgressCallback(uPercentage, pvUser);
     577}
    566578
    567579// IProgress properties
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