VirtualBox

Changeset 101097 in vbox


Ignore:
Timestamp:
Sep 12, 2023 11:20:03 PM (20 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159066
Message:

VBoxDbg: Moved the dInt column next to the main value column it relates to. This reduces the rectangle that needs to be invalidated on updates of non-profile type nodes. Added a '+' to positive dInt values to emphasize that it's a delta.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/VBoxDbgStatsQt.cpp

    r101095 r101097  
    659659 * (18 446 744 073 709 551 615)
    660660 */
    661 static char *formatNumberSigned(char *psz, int64_t i64)
     661static char *formatNumberSigned(char *psz, int64_t i64, bool fPositivePlus = false)
    662662{
    663663    static const char s_szDigits[] = "0123456789";
     
    680680    if (fNegative)
    681681        *--psz = '-';
     682    else if (fPositivePlus)
     683        *--psz = '+';
    682684    return psz;
    683685}
     
    19501952                    if (iChild >= pNode->cChildren)
    19511953                        break;
    1952                     QModelIndex const TopLeft = createIndex(iChild, 2, pNode->papChildren[iChild]);
    1953                     pNode->papChildren[iChild]->enmState = kDbgGuiStatsNodeState_kVisible;
     1954                    PDBGGUISTATSNODE  pChild    = pNode->papChildren[iChild];
     1955                    QModelIndex const TopLeft   = createIndex(iChild, 2, pChild);
     1956                    pChild->enmState = kDbgGuiStatsNodeState_kVisible;
    19541957
    19551958                    /* Any subsequent nodes that also needs refreshing? */
    1956                     while (   iChild + 1 < pNode->cChildren
    1957                            && pNode->papChildren[iChild + 1]->enmState == kDbgGuiStatsNodeState_kRefresh)
    1958                         iChild++;
     1959                    int const iRightCol = pChild->enmType != STAMTYPE_PROFILE && pChild->enmType != STAMTYPE_PROFILE_ADV ? 4 : 7;
     1960                    if (iRightCol == 4)
     1961                        while (   iChild + 1 < pNode->cChildren
     1962                               && (pChild = pNode->papChildren[iChild + 1])->enmState == kDbgGuiStatsNodeState_kRefresh
     1963                               && pChild->enmType != STAMTYPE_PROFILE
     1964                               && pChild->enmType != STAMTYPE_PROFILE_ADV)
     1965                            iChild++;
     1966                    else
     1967                        while (   iChild + 1 < pNode->cChildren
     1968                               && (pChild = pNode->papChildren[iChild + 1])->enmState == kDbgGuiStatsNodeState_kRefresh
     1969                               && (   pChild->enmType == STAMTYPE_PROFILE
     1970                                   || pChild->enmType == STAMTYPE_PROFILE_ADV))
     1971                            iChild++;
    19591972
    19601973                    /* emit the refresh signal */
    1961                     QModelIndex const BottomRight = createIndex(iChild, DBGGUI_STATS_COLUMNS - 2, pNode->papChildren[iChild]);
     1974                    QModelIndex const BottomRight = createIndex(iChild, iRightCol, pNode->papChildren[iChild]);
    19621975                    emit dataChanged(TopLeft, BottomRight);
    19631976                    iChild++;
     
    21942207            case 1: return tr("Unit");
    21952208            case 2: return tr("Value/Times");
    2196             case 3: return tr("Min");
    2197             case 4: return tr("Average");
    2198             case 5: return tr("Max");
    2199             case 6: return tr("Total");
    2200             case 7: return tr("dInt");
     2209            case 3: return tr("dInt");
     2210            case 4: return tr("Min");
     2211            case 5: return tr("Average");
     2212            case 6: return tr("Max");
     2213            case 7: return tr("Total");
    22012214            case 8: return tr("Description");
    22022215            default:
     
    24172430        case STAMTYPE_BOOL:
    24182431        case STAMTYPE_BOOL_RESET:
    2419             return formatNumberSigned(sz, pNode->i64Delta);
     2432            if (pNode->i64Delta)
     2433                return formatNumberSigned(sz, pNode->i64Delta, true /*fPositivePlus*/);
     2434            return "0";
    24202435        default:
    24212436            return "";
     
    24452460                return strValueTimes(pNode);
    24462461            case 3:
     2462                return strDeltaValue(pNode);
     2463            case 4:
    24472464                return strMinValue(pNode);
    2448             case 4:
     2465            case 5:
    24492466                return strAvgValue(pNode);
    2450             case 5:
     2467            case 6:
    24512468                return strMaxValue(pNode);
    2452             case 6:
     2469            case 7:
    24532470                return strTotalValue(pNode);
    2454             case 7:
    2455                 return strDeltaValue(pNode);
    24562471            case 8:
    24572472                return pNode->pDescStr ? QString(*pNode->pDescStr) : QString("");
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