summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 13:29:06 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 13:29:06 +0200
commit461341f8489b1de73aee609f3830a8865f885c21 (patch)
treec5760867aab97931f55933ea1a65d34198e18ef7
parent0f563d500a73db4a601a1f09f374d68645bf0d9b (diff)
downloadtelepathy-logger-461341f8489b1de73aee609f3830a8865f885c21.tar.gz
remove unused _tpl_time_to_string_relative
-rw-r--r--telepathy-logger/datetime-internal.h1
-rw-r--r--telepathy-logger/datetime.c58
2 files changed, 0 insertions, 59 deletions
diff --git a/telepathy-logger/datetime-internal.h b/telepathy-logger/datetime-internal.h
index 6811910..95eff20 100644
--- a/telepathy-logger/datetime-internal.h
+++ b/telepathy-logger/datetime-internal.h
@@ -38,7 +38,6 @@ time_t _tpl_time_get_local_time (struct tm *tm);
time_t _tpl_time_parse (const gchar * str);
gchar *_tpl_time_to_string_utc (time_t t, const gchar * format);
gchar *_tpl_time_to_string_local (time_t t, const gchar * format);
-gchar *_tpl_time_to_string_relative (time_t t);
G_END_DECLS
#endif /* __TPL_TIME_H__ */
diff --git a/telepathy-logger/datetime.c b/telepathy-logger/datetime.c
index 999b9e8..d164164 100644
--- a/telepathy-logger/datetime.c
+++ b/telepathy-logger/datetime.c
@@ -125,61 +125,3 @@ _tpl_time_to_string_local (time_t t,
return g_strdup (stamp);
}
-
-gchar *
-_tpl_time_to_string_relative (time_t then)
-{
- time_t now;
- gint seconds;
-
- now = time (NULL);
- seconds = now - then;
-
- if (seconds > 0)
- {
- if (seconds < 60)
- {
- return g_strdup_printf (ngettext ("%d second ago",
- "%d seconds ago", seconds),
- seconds);
- }
- else if (seconds < (60 * 60))
- {
- seconds /= 60;
- return g_strdup_printf (ngettext ("%d minute ago",
- "%d minutes ago", seconds),
- seconds);
- }
- else if (seconds < (60 * 60 * 24))
- {
- seconds /= 60 * 60;
- return g_strdup_printf (ngettext ("%d hour ago",
- "%d hours ago", seconds),
- seconds);
- }
- else if (seconds < (60 * 60 * 24 * 7))
- {
- seconds /= 60 * 60 * 24;
- return g_strdup_printf (ngettext ("%d day ago",
- "%d days ago", seconds), seconds);
- }
- else if (seconds < (60 * 60 * 24 * 30))
- {
- seconds /= 60 * 60 * 24 * 7;
- return g_strdup_printf (ngettext ("%d week ago",
- "%d weeks ago", seconds),
- seconds);
- }
- else
- {
- seconds /= 60 * 60 * 24 * 30;
- return g_strdup_printf (ngettext ("%d month ago",
- "%d months ago", seconds),
- seconds);
- }
- }
- else
- {
- return g_strdup (_("in the future"));
- }
-}