[gnome-software: 12/24] gs-category-page: Factor out category loading code
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 12/24] gs-category-page: Factor out category loading code
- Date: Mon, 3 May 2021 15:24:13 +0000 (UTC)
commit 69b954e46b248c0724c59b0840a5be00613f6d0e
Author: Philip Withnall <pwithnall endlessos org>
Date: Thu Apr 22 14:46:47 2021 +0100
gs-category-page: Factor out category loading code
The following few commits will increase reuse of this code and tidy it
up a bit.
This commit introduces no functional changes.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
src/gs-category-page.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index 5782d19af..0207c78ee 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -187,15 +187,13 @@ gs_category_page_set_featured_apps (GsCategoryPage *self)
}
static void
-gs_category_page_reload (GsPage *page)
+gs_category_page_load_category (GsCategoryPage *self)
{
- GsCategoryPage *self = GS_CATEGORY_PAGE (page);
GtkWidget *tile;
guint i, count;
g_autoptr(GsPluginJob) plugin_job = NULL;
- if (self->subcategory == NULL)
- return;
+ g_assert (self->subcategory != NULL);
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
@@ -232,6 +230,17 @@ gs_category_page_reload (GsPage *page)
self);
}
+static void
+gs_category_page_reload (GsPage *page)
+{
+ GsCategoryPage *self = GS_CATEGORY_PAGE (page);
+
+ if (self->subcategory == NULL)
+ return;
+
+ gs_category_page_load_category (self);
+}
+
void
gs_category_page_set_category (GsCategoryPage *self, GsCategory *category)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]