[gnome-packagekit] Only show 'and n other security updates when there are other updates to list. Fixes rh#527149



commit cf4d13b1774d4a1aa53640351af6d738b6414ce1
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 5 10:00:24 2009 +0100

    Only show 'and n other security updates when there are other updates to list. Fixes rh#527149

 src/gpk-check-update.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/gpk-check-update.c b/src/gpk-check-update.c
index c347150..1a7913c 100644
--- a/src/gpk-check-update.c
+++ b/src/gpk-check-update.c
@@ -854,10 +854,12 @@ gpk_check_update_process_updates (GpkCheckUpdate *cupdate, PkPackageList *list,
 					obj->id->name, obj->summary);
 		if (++showing == GPK_CHECK_UPDATE_MAX_NUMBER_SECURITY_ENTRIES) {
 			more = security_array->len - showing;
-			/* TRANSLATORS: we have a notification that won't fit, so append on how many other we are not showing */
-			g_string_append_printf (status_security, ngettext ("and %d other security update",
-									   "and %d other security updates", more), more);
-			g_string_append (status_security, "...\n");
+			if (more > 0) {
+				/* TRANSLATORS: we have a notification that won't fit, so append on how many other we are not showing */
+				g_string_append_printf (status_security, ngettext ("and %d other security update",
+										   "and %d other security updates", more), more);
+				g_string_append (status_security, "...\n");
+			}
 			break;
 		}
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]