VirtualBox

Changeset 85592 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 3, 2020 10:22:00 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686, bugref:9510. Implementing copy ctor for UIResourceMonitorItem

File:
1 edited

Legend:

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

    r85550 r85592  
    220220    UIResourceMonitorItem(const QUuid &uid);
    221221    UIResourceMonitorItem();
     222    UIResourceMonitorItem(const UIResourceMonitorItem &item);
     223    ~UIResourceMonitorItem();
    222224    bool operator==(const UIResourceMonitorItem& other) const;
    223     bool isWithGuestAdditions() const;
     225    bool isWithGuestAdditions();
    224226
    225227    QUuid    m_VMuid;
     
    246248    quint64 m_uVMExitTotal;
    247249
     250    CSession m_comSession;
    248251    CMachineDebugger m_comDebugger;
    249     mutable CGuest   m_comGuest;
     252    CGuest   m_comGuest;
    250253    /** The strings of each column for the item. We update this during performance query
    251254      * instead of model's data function to know the string length earlier. */
     
    766769    , m_uVMExitTotal(0)
    767770{
    768     CSession comSession = uiCommon().openSession(uid, KLockType_Shared);
    769     if (!comSession.isNull())
    770     {
    771         CConsole comConsole = comSession.GetConsole();
     771    m_comSession = uiCommon().openSession(uid, KLockType_Shared);
     772    if (!m_comSession.isNull())
     773    {
     774        CConsole comConsole = m_comSession.GetConsole();
    772775        if (!comConsole.isNull())
    773776        {
     
    818821}
    819822
     823UIResourceMonitorItem::~UIResourceMonitorItem()
     824{
     825    if (!m_comSession.isNull())
     826        m_comSession.UnlockMachine();
     827}
     828
     829UIResourceMonitorItem::UIResourceMonitorItem(const UIResourceMonitorItem &other)
     830    : m_VMuid(other.m_VMuid)
     831    , m_strVMName(other.m_strVMName)
     832    , m_uCPUGuestLoad(other.m_uCPUGuestLoad)
     833    , m_uCPUVMMLoad(other.m_uCPUVMMLoad)
     834    , m_uTotalRAM(other.m_uTotalRAM)
     835    , m_uFreeRAM(other.m_uFreeRAM)
     836    , m_uUsedRAM(other.m_uUsedRAM)
     837    , m_fRAMUsagePercentage(other.m_fRAMUsagePercentage)
     838    , m_uNetworkDownRate(other.m_uNetworkDownRate)
     839    , m_uNetworkUpRate(other.m_uNetworkUpRate)
     840    , m_uNetworkDownTotal(other.m_uNetworkDownTotal)
     841    , m_uNetworkUpTotal(other.m_uNetworkUpTotal)
     842    , m_uDiskWriteRate(other.m_uDiskWriteRate)
     843    , m_uDiskReadRate(other.m_uDiskReadRate)
     844    , m_uDiskWriteTotal(other.m_uDiskWriteTotal)
     845    , m_uDiskReadTotal(other.m_uDiskReadTotal)
     846    , m_uVMExitRate(other.m_uVMExitRate)
     847    , m_uVMExitTotal(other.m_uVMExitTotal)
     848    , m_comSession(other.m_comSession)
     849    , m_comDebugger(other.m_comDebugger)
     850    , m_comGuest(other.m_comGuest)
     851    , m_columnData(other.m_columnData)
     852{
     853}
     854
    820855bool UIResourceMonitorItem::operator==(const UIResourceMonitorItem& other) const
    821856{
     
    825860}
    826861
    827 bool UIResourceMonitorItem::isWithGuestAdditions() const
     862bool UIResourceMonitorItem::isWithGuestAdditions()
    828863{
    829864    if (m_comGuest.isNull())
     
    963998        emit layoutChanged();
    964999        setupPerformanceCollector();
     1000        return;
    9651001    }
    9661002    /* Insert the machine if it is working. */
     
    9731009        emit layoutChanged();
    9741010        setupPerformanceCollector();
     1011        return;
    9751012    }
    9761013}
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