KVIrc  4.9.2
DeveloperAPIs
Enumerations | Functions
KviTimeUtils Namespace Reference

Time utilities. More...

Enumerations

enum  FormatTimeSpanFlags { NoLeadingEmptyIntervals = 1, NoLeadingZeroes = 2, FillWithHypens = 4 }
 

Functions

QString formatTimeInterval (unsigned int uSeconds, int iFlags=0)
 Returns a string formatted like x d x h xx m xx s. More...
 
long long getCurrentTimeMills ()
 Returns the current time mills. More...
 
void secondsToDaysHoursMinsSecs (unsigned int uSecs, unsigned int *uD, unsigned int *uH, unsigned int *uM, unsigned int *uS)
 Splits the time span uSecs in days, hours, minutes and seconds. More...
 

Detailed Description

Time utilities.

Enumeration Type Documentation

Enumerator
NoLeadingEmptyIntervals 

Causes the leading empty intervals to be omitted

NoLeadingZeroes 

No leading zeroes are printed in hours and seconds

FillWithHypens 

Uses only – d – h – etc.. discards all other flags

Function Documentation

KVILIB_API QString KviTimeUtils::formatTimeInterval ( unsigned int  uSeconds,
int  iFlags = 0 
)

Returns a string formatted like x d x h xx m xx s.

Parameters
uSecondsThe number of seconds to format
iFlagsThe flags to format the time string
Returns
QString

References __tr2qs, d, FillWithHypens, h, m, NoLeadingEmptyIntervals, NoLeadingZeroes, s, and secondsToDaysHoursMinsSecs().

Referenced by DccFileTransfer::displayPaint(), KviConsoleWindow::getWindowListTipText(), KviStatusBarConnectionTimer::timerEvent(), and KviStatusBarAwayIndicator::tipText().

KVILIB_API long long KviTimeUtils::getCurrentTimeMills ( )

Returns the current time mills.

Returns
long long

References kvi_gettimeofday().

Referenced by KviAnimatedPixmapCache::internalScheduleFrameChange(), and KviAnimatedPixmapCache::timeoutEvent().

KVILIB_API void KviTimeUtils::secondsToDaysHoursMinsSecs ( unsigned int  uSecs,
unsigned int *  uD,
unsigned int *  uH,
unsigned int *  uM,
unsigned int *  uS 
)

Splits the time span uSecs in days, hours, minutes and seconds.

Parameters
uSecsThe amount of seconds to span
uDWhere to store days data
uHWhere to store hours data
uMWhere to store minutes data
uSWhere to store seconds data
Returns
void

Referenced by HttpFileTransfer::displayPaint(), and formatTimeInterval().