From 8de9ee8b8d158f58738cc4a1084c0f42a01d427e Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 19 Dec 2016 23:28:57 +0100 Subject: [PATCH] made friendly time unit returns empty string when time is 0. Fixes 46y display in search dialog --- retroshare-gui/src/util/misc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroshare-gui/src/util/misc.cpp b/retroshare-gui/src/util/misc.cpp index ef91dbe8c..08fa72f5d 100644 --- a/retroshare-gui/src/util/misc.cpp +++ b/retroshare-gui/src/util/misc.cpp @@ -209,6 +209,9 @@ QString misc::userFriendlyDuration(qlonglong seconds) QString misc::timeRelativeToNow(uint32_t mtime) { + if(mtime == 0) + return QString(); + time_t now = time(NULL) ; if(mtime > now) return misc::userFriendlyDuration(mtime - (int)now) + " (ahead of now)";