[gnome-software] trivial: Ignore categories that have no applications when promoting
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Ignore categories that have no applications when promoting
- Date: Fri, 10 Jun 2016 15:36:39 +0000 (UTC)
commit 38595105488220255dcdd07957f8e2c5dfca7fbc
Author: Richard Hughes <richard hughsie com>
Date: Fri Jun 10 16:36:00 2016 +0100
trivial: Ignore categories that have no applications when promoting
src/gs-shell-overview.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index 9da1887..a4f1a3a 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -342,6 +342,8 @@ gs_shell_overview_get_categories_cb (GObject *source_object,
important_aim = 2 * gtk_flow_box_get_max_children_per_line (flowbox);
for (i = 0; i < list->len; i++) {
cat = GS_CATEGORY (g_ptr_array_index (list, i));
+ if (gs_category_get_size (cat) == 0)
+ continue;
if (gs_category_get_important (cat)) {
if (++important_cnt > important_aim) {
g_debug ("overriding %s as unimportant",
@@ -354,6 +356,8 @@ gs_shell_overview_get_categories_cb (GObject *source_object,
/* ensure we show a full first flowbox if we don't have enough */
for (i = 0; i < list->len && important_cnt < important_aim; i++) {
cat = GS_CATEGORY (g_ptr_array_index (list, i));
+ if (gs_category_get_size (cat) == 0)
+ continue;
if (!gs_category_get_important (cat)) {
important_cnt++;
g_debug ("overriding %s as important",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]