fixed problems with negative time shifts in DirDetails causing multiple GUI bugs in File Lists and Search

This commit is contained in:
csoler 2016-11-14 21:58:58 +01:00
parent d433713bd0
commit 8c8cc88503
9 changed files with 56 additions and 40 deletions

View file

@ -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) {