VirtualBox

Changeset 83468 in vbox


Ignore:
Timestamp:
Mar 27, 2020 1:28:05 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686. Marking RAM column as N/A when guest additions is not avaible.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp

    r83466 r83468  
    382382    if (!index.isValid() || role != Qt::DisplayRole || index.row() >= rowCount())
    383383        return QVariant();
     384    UIResourceMonitorItem* pItem = static_cast<UIResourceMonitorItem*>(index.internalPointer());
    384385
    385386    switch (index.column())
     
    395396            break;
    396397        case VMResouceMonitorColumn_RAMUsedAndTotal:
    397             return QString("%1/%2").arg(uiCommon().formatSize(_1K * m_itemList[index.row()].m_uUsedRAM, iDecimalCount)).
    398                 arg(uiCommon().formatSize(_1K * m_itemList[index.row()].m_uTotalRAM, iDecimalCount));
     398            if (pItem && pItem->isWithGuestAdditions())
     399                return QString("%1/%2").arg(uiCommon().formatSize(_1K * m_itemList[index.row()].m_uUsedRAM, iDecimalCount)).
     400                    arg(uiCommon().formatSize(_1K * m_itemList[index.row()].m_uTotalRAM, iDecimalCount));
     401            else
     402                return tr("N/A");
    399403            break;
    400404        case VMResouceMonitorColumn_RAMUsedPercentage:
    401             return QString("%1%").arg(QString::number(m_itemList[index.row()].m_fRAMUsagePercentage, 'f', 2));
     405            if (pItem && pItem->isWithGuestAdditions())
     406                return QString("%1%").arg(QString::number(m_itemList[index.row()].m_fRAMUsagePercentage, 'f', 2));
     407            else
     408                return tr("N/A");
    402409            break;
    403410        case VMResouceMonitorColumn_NetworkUpRate:
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