mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-01 04:46:47 -05:00
fixed problems with negative time shifts in DirDetails causing multiple GUI bugs in File Lists and Search
This commit is contained in:
parent
d433713bd0
commit
8c8cc88503
9 changed files with 56 additions and 40 deletions
|
|
@ -206,6 +206,15 @@ QString misc::userFriendlyDuration(qlonglong seconds)
|
|||
return tr("%1y %2d", "e.g: 2 years 2days ").arg(years).arg(days);
|
||||
}
|
||||
|
||||
QString misc::timeRelativeToNow(uint32_t mtime)
|
||||
{
|
||||
time_t now = time(NULL) ;
|
||||
if(mtime > now)
|
||||
return misc::userFriendlyDuration(mtime - (int)now) + " (ahead of now)";
|
||||
else
|
||||
return misc::userFriendlyDuration(now - (int)mtime) ;
|
||||
}
|
||||
|
||||
QString misc::userFriendlyUnit(double count, unsigned int decimal, double factor)
|
||||
{
|
||||
if (count <= 0.0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue