[gnome-software] Never show '[0]' in the installed panel tab
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Never show '[0]' in the installed panel tab
- Date: Wed, 22 Jan 2014 09:42:15 +0000 (UTC)
commit 271cd03d9c47c9aedb7ce964fa4ff5bf76eb14af
Author: Richard Hughes <richard hughsie com>
Date: Wed Jan 22 09:40:22 2014 +0000
Never show '[0]' in the installed panel tab
src/gs-shell-installed.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 4e6a096..2d30bde 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -528,21 +528,22 @@ static void
gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
GsShellInstalled *shell_installed)
{
- gchar *label;
GPtrArray *pending;
+ GsApp *app;
GtkWidget *widget;
+ gchar *label;
guint i;
- GsApp *app;
widget = GTK_WIDGET (gtk_builder_get_object (shell_installed->priv->builder,
"button_installed_counter"));
pending = gs_plugin_loader_get_pending (plugin_loader);
if (pending->len == 0) {
- //gtk_widget_hide (widget);
- label = g_strdup ("0");
+ gtk_widget_hide (widget);
} else {
gtk_widget_show (widget);
label = g_strdup_printf ("%d", pending->len);
+ gtk_label_set_label (GTK_LABEL (widget), label);
+ g_free (label);
}
for (i = 0; i < pending->len; i++) {
app = GS_APP (g_ptr_array_index (pending, i));
@@ -563,8 +564,6 @@ gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
}
}
- gtk_label_set_label (GTK_LABEL (widget), label);
- g_free (label);
g_ptr_array_unref (pending);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]