VirtualBox

儲存庫 vbox 的更動 52385


忽略:
時間撮記:
2014-8-14 下午04:40:36 (10 年 以前)
作者:
vboxsync
訊息:

FE/Qt: Coding-style / warning fix for r95440.

位置:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r52319 r52385  
    10401040void UIIndicatorsPool::sltAutoUpdateIndicatorStates()
    10411041{
    1042     /* Update states for following indicators: */
    1043     QVector <KDeviceType> deviceTypes(0);
    1044 
     1042    /* We should update states for following indicators: */
     1043    QVector<KDeviceType> deviceTypes;
    10451044    if (m_pool.contains(IndicatorType_HardDisks))
    10461045        deviceTypes.append(KDeviceType_HardDisk);
     
    10581057        deviceTypes.append(KDeviceType_Graphics3D);
    10591058
     1059    /* Acquire current states from the console: */
    10601060    CConsole console = m_session.GetConsole();
    1061     QVector <KDeviceActivity> activities = console.GetDeviceActivity(deviceTypes);
    1062     if (!console.isOk())
    1063         return;
    1064 
    1065     int i;
    1066     for (i = 0; i < activities.size(); ++i)
    1067     {
    1068         QIStatusBarIndicator *pIndicator = NULL;
    1069 
    1070         switch (deviceTypes[i])
    1071         {
    1072             case KDeviceType_HardDisk:
    1073                 pIndicator = m_pool.value(IndicatorType_HardDisks);
    1074                 break;
    1075             case KDeviceType_DVD:
    1076                 pIndicator = m_pool.value(IndicatorType_OpticalDisks);
    1077                 break;
    1078             case KDeviceType_Floppy:
    1079                 pIndicator = m_pool.value(IndicatorType_FloppyDisks);
    1080                 break;
    1081             case KDeviceType_USB:
    1082                 pIndicator = m_pool.value(IndicatorType_USB);
    1083                 break;
    1084             case KDeviceType_Network:
    1085                 pIndicator = m_pool.value(IndicatorType_Network);
    1086                 break;
    1087             case KDeviceType_SharedFolder:
    1088                 pIndicator = m_pool.value(IndicatorType_SharedFolders);
    1089                 break;
    1090             case KDeviceType_Graphics3D:
    1091                 pIndicator = m_pool.value(IndicatorType_Display);
    1092                 break;
    1093             default:
    1094                 AssertFailed();
    1095                 break;
    1096         }
    1097 
     1061    const QVector<KDeviceActivity> states = console.GetDeviceActivity(deviceTypes);
     1062    AssertReturnVoid(console.isOk());
     1063
     1064    /* Update indicators with the acquired states: */
     1065    for (int iIndicator = 0; iIndicator < states.size(); ++iIndicator)
     1066    {
     1067        QIStatusBarIndicator *pIndicator = 0;
     1068        switch (deviceTypes[iIndicator])
     1069        {
     1070            case KDeviceType_HardDisk:     pIndicator = m_pool.value(IndicatorType_HardDisks); break;
     1071            case KDeviceType_DVD:          pIndicator = m_pool.value(IndicatorType_OpticalDisks); break;
     1072            case KDeviceType_Floppy:       pIndicator = m_pool.value(IndicatorType_FloppyDisks); break;
     1073            case KDeviceType_USB:          pIndicator = m_pool.value(IndicatorType_USB); break;
     1074            case KDeviceType_Network:      pIndicator = m_pool.value(IndicatorType_Network); break;
     1075            case KDeviceType_SharedFolder: pIndicator = m_pool.value(IndicatorType_SharedFolders); break;
     1076            case KDeviceType_Graphics3D:   pIndicator = m_pool.value(IndicatorType_Display); break;
     1077            default: AssertFailed(); break;
     1078        }
    10981079        if (pIndicator)
    1099             updateIndicatorStateForDevice(pIndicator, deviceTypes[i], activities[i]);
     1080            updateIndicatorStateForDevice(pIndicator, states[iIndicator]);
    11001081    }
    11011082}
     
    12941275}
    12951276
    1296 void UIIndicatorsPool::updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceType deviceType,
    1297                                                      KDeviceActivity deviceActivity)
     1277void UIIndicatorsPool::updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceActivity state)
    12981278{
    12991279    /* Assert indicators with NO state: */
     
    13151295    {
    13161296        /* If current state differs from actual => set the actual one: */
    1317         const int iState = (int)deviceActivity;
     1297        const int iState = (int)state;
    13181298        if (pStateIndicator->state() != iState)
    13191299            pStateIndicator->setState(iState);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h

    r52319 r52385  
    9898    int indicatorPosition(IndicatorType indicatorType) const;
    9999
    100     /** Updates state for passed @a pIndicator through @a deviceType. */
    101     void updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceType deviceType,
    102                                        KDeviceActivity deviceActivity);
     100    /** Updates passed @a pIndicator with current @a state value. */
     101    void updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceActivity state);
    103102
    104103    /** Holds the UI session reference. */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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