From cd4f548dd5427b48706b29c17a8ea67d6360afd8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 12 Jan 2009 17:22:47 -0600 Subject: Whoo Hoo, we can count --- libindicate/server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libindicate/server.c b/libindicate/server.c index 17db3dc..48f1c71 100644 --- a/libindicate/server.c +++ b/libindicate/server.c @@ -230,6 +230,11 @@ get_desktop (IndicateServer * server, gchar ** desktop_path, GError **error) static gboolean get_indicator_count (IndicateServer * server, guint * count, GError **error) { + guint lstcnt = g_slist_length(server->indicators); + + g_return_val_if_fail(server->num_hidden < lstcnt, TRUE); + + *count = lstcnt - server->num_hidden; return TRUE; } -- cgit v1.2.3