changeset 9424:79c4acbac4cd

[gaim-migrate @ 10242] " gaim_str_seconds_to_string returns an empty string for lengths of time under 1 minute. This leads to some odd-looking tooltips for people who have just logged in, for example. This patch resolves this by providing a nice seconds count for times under 1 minute." --Alan Ford committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 29 Jun 2004 12:50:17 +0000
parents 2c6af2767fcf
children 42afbd004e6a
files COPYRIGHT ChangeLog src/util.c
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Tue Jun 29 12:29:22 2004 +0000
+++ b/COPYRIGHT	Tue Jun 29 12:50:17 2004 +0000
@@ -49,6 +49,7 @@
 Gavan Fantom (gavan)
 Rob Flynn <gaim@robflynn.com>
 Rob (rwf) Foehl
+Alan Ford
 Nathan Fredrickson
 Chris J. Friesen
 Free Software Foundation
--- a/ChangeLog	Tue Jun 29 12:29:22 2004 +0000
+++ b/ChangeLog	Tue Jun 29 12:50:17 2004 +0000
@@ -9,6 +9,8 @@
 	* The firefox browser option now works with firefox 0.9
 	* Buddy icons in conversations no longer depend on the
 	  buddy list
+	* Fix for the bug where some buddies seemed logged in 4
+	  thousand some odd days (Alan Ford)
 
 version 0.79 (06/24/2004):
 	New Features:
--- a/src/util.c	Tue Jun 29 12:29:22 2004 +0000
+++ b/src/util.c	Tue Jun 29 12:50:17 2004 +0000
@@ -2384,6 +2384,15 @@
 	const char *prefix = "";
 	guint days, hrs, mins;
 
+	gstr = g_string_new("");
+
+	if (secs < 60)
+	{
+		g_string_append_printf(gstr, "%d %s", secs,
+							   ngettext("second", "seconds", secs));
+		return g_string_free(gstr, FALSE);
+	}
+
 	days = secs / (60 * 60 * 24);
 	secs = secs % (60 * 60 * 24);
 	hrs  = secs / (60 * 60);
@@ -2391,8 +2400,6 @@
 	mins = secs / 60;
 	secs = secs % 60;
 
-	gstr = g_string_new("");
-
 	if (days > 0)
 	{
 		g_string_append_printf(gstr, "%d %s", days,