VirtualBox

儲存庫 vbox 的更動 18394


忽略:
時間撮記:
2009-3-27 下午02:04:43 (16 年 以前)
作者:
vboxsync
訊息:

Main: do not allow IProgress to report 100% until we're really done

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/ProgressImpl.cpp

    r18306 r18394  
    271271    else
    272272    {
    273         /* global percent =
    274          *      (100 / m_cOperations) * mOperation +
    275          *      ((100 / m_cOperations) / 100) * m_ulOperationPercent */
    276 //         *aPercent = (100 * mOperation + m_ulOperationPercent) / m_cOperations;
    277 
    278         *aPercent = (ULONG)(    (    (double)m_ulOperationsCompletedWeight                                              // weight of operations that have been completed
    279                                    + ((double)m_ulOperationPercent * (double)m_ulCurrentOperationWeight / (double)100)  // plus partial weight of the current operation
    280                                 ) * (double)100 / (double)m_ulTotalOperationsWeight);
     273        ULONG ulPercent = (ULONG)(    (    (double)m_ulOperationsCompletedWeight                                              // weight of operations that have been completed
     274                                         + ((double)m_ulOperationPercent * (double)m_ulCurrentOperationWeight / (double)100)  // plus partial weight of the current operation
     275                                      ) * (double)100 / (double)m_ulTotalOperationsWeight
     276                                 );
     277        // do not report 100% until we're really really done with everything as the Qt GUI dismisses progress dialogs in that case
     278        if (    ulPercent == 100
     279             && (    m_ulOperationPercent < 100
     280                  || (m_ulCurrentOperation < m_cOperations -1)
     281                )
     282           )
     283            *aPercent = 99;
     284        else
     285            *aPercent = ulPercent;
    281286    }
    282287
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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