mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
104095c6be
commit
49d11549b9
|
@ -868,16 +868,15 @@ QString ChatForm::secondsToDHMS(quint32 duration)
|
||||||
int hours = (int) (duration % 24);
|
int hours = (int) (duration % 24);
|
||||||
int days = (int) (duration / 24);
|
int days = (int) (duration / 24);
|
||||||
|
|
||||||
if (minutes == 0)
|
// I assume no one will ever have call longer than a month
|
||||||
return cD + res.sprintf("%02ds", seconds);
|
if (days)
|
||||||
|
return cD + res.sprintf("%dd%02dh %02dm %02ds", days, hours, minutes, seconds);
|
||||||
if (hours == 0 && days == 0)
|
else if (hours)
|
||||||
return cD + res.sprintf("%02dm %02ds", minutes, seconds);
|
|
||||||
|
|
||||||
if (days == 0)
|
|
||||||
return cD + res.sprintf("%02dh %02dm %02ds", hours, minutes, seconds);
|
return cD + res.sprintf("%02dh %02dm %02ds", hours, minutes, seconds);
|
||||||
//I assume no one will ever have call longer than ~30days
|
else if (minutes)
|
||||||
return cD + res.sprintf("%dd%02dh %02dm %02ds", days, hours, minutes, seconds);
|
return cD + res.sprintf("%02dm %02ds", minutes, seconds);
|
||||||
|
else
|
||||||
|
return cD + res.sprintf("%02ds", seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatForm::setFriendTyping(bool isTyping)
|
void ChatForm::setFriendTyping(bool isTyping)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user