[gnome-software] Never show '0' as the updates counter
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Never show '0' as the updates counter
- Date: Mon, 16 Dec 2013 12:32:42 +0000 (UTC)
commit 840a9422da0b093d7666c2312e8f11461892420e
Author: Richard Hughes <richard hughsie com>
Date: Mon Dec 16 12:32:24 2013 +0000
Never show '0' as the updates counter
We don't return an error on 0 updates now, so we need the length check.
src/gs-shell-updates.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 303614d..db938fc 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -90,7 +90,7 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
list = gs_plugin_loader_get_updates_finish (plugin_loader, res, &error);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates_counter"));
- if (list != NULL) {
+ if (list != NULL && g_list_length (list) > 0) {
gchar *text;
text = g_strdup_printf ("%d", g_list_length (list));
gtk_label_set_label (GTK_LABEL (widget), text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]