VirtualBox

Changeset 107867 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 21, 2025 6:29:59 AM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167074
Message:

bugref:10806. Revised the functions updateLastAccessTime() and initIdleTime().

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ObjectsTracker.h

    r107254 r107867  
    155155    }
    156156
    157     com::Utf8Str updateLastAccessTime();
    158     com::Utf8Str initIdleTime();
     157    RTTIMESPEC updateLastAccessTime();
     158    RTTIMESPEC initIdleTime();
    159159    com::Utf8Str creationTimeStr() const;
    160160    TrackedObjectState_T deletionTime(PRTTIMESPEC aTime) const;
  • trunk/src/VBox/Main/src-all/ObjectsTracker.cpp

    r107866 r107867  
    276276}
    277277
    278 com::Utf8Str TrackedObjectData::updateLastAccessTime()
     278RTTIMESPEC TrackedObjectData::updateLastAccessTime()
    279279{
    280280    RTTimeNow(&m_lastAccessTime);
    281 
    282     char szTime[RTTIME_STR_LEN];
    283     RTTimeSpecToString(&m_lastAccessTime, szTime, sizeof(szTime));
    284     return com::Utf8Str(szTime);
    285 }
    286 
    287 /** @todo r=bird: why on earth does this return a string? */
    288 com::Utf8Str TrackedObjectData::initIdleTime()
     281    return m_lastAccessTime;
     282}
     283
     284RTTIMESPEC TrackedObjectData::initIdleTime()
    289285{
    290286    if (!m_fIdleTimeStart)
     
    297293    }
    298294
    299     char szTime[RTTIME_STR_LEN];
    300     RTTimeSpecToString(&m_idleTimeStart, szTime, sizeof(szTime));
    301     return com::Utf8Str(szTime);
     295    return m_idleTimeStart;
    302296}
    303297
     
    562556        {
    563557            /* Update some fields in the found object if needed. in instance, the last access time */
    564             com::Utf8Str lat = pIter->second.updateLastAccessTime(); /* Update the access time */
    565             Log2(("The updated last access time is %s\n", lat.c_str()));
     558            RTTIMESPEC lat = pIter->second.updateLastAccessTime(); /* Update the access time */
     559            char szTime[RTTIME_STR_LEN];
     560            RTTimeSpecToString(&lat, szTime, sizeof(szTime));
     561            Log2(("The updated last access time is %s\n", szTime));
    566562        }
    567563        hrc = S_OK;
     
    609605    {
    610606        /* Init idle time only once, next time returns the initialization time */
    611         com::Utf8Str strTime = pIter->second.initIdleTime();
    612         Log2(("The idle time start is %s\n", strTime.c_str()));
     607        RTTIMESPEC idleTime = pIter->second.initIdleTime();
     608        char szTime[RTTIME_STR_LEN];
     609        RTTimeSpecToString(&idleTime, szTime, sizeof(szTime));
     610        Log2(("The idle time start is %s\n", szTime));
    613611        vrc = VINF_SUCCESS;
    614612    }
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