[recipes] Move all_headers to utils
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Move all_headers to utils
- Date: Tue, 31 Jan 2017 11:18:18 +0000 (UTC)
commit 3b1445775b882bf8d60cba243771093d1a641016
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jan 31 12:05:34 2017 +0100
Move all_headers to utils
Thats better than keeping a million static copies.
src/gr-details-page.c | 15 ---------------
src/gr-edit-page.c | 15 ---------------
src/gr-recipe-exporter.c | 15 ---------------
src/gr-shopping-page.c | 15 ---------------
src/gr-utils.c | 15 +++++++++++++++
src/gr-utils.h | 4 ++++
6 files changed, 19 insertions(+), 60 deletions(-)
---
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index 6012bd6..eb0b76b 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -564,21 +564,6 @@ gdouble_to_boolean (GBinding *binding,
return TRUE;
}
-static void
-all_headers (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
-{
- GtkWidget *header;
-
- header = gtk_list_box_row_get_header (row);
- if (header)
- return;
-
- header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_list_box_row_set_header (row, header);
-}
-
static gboolean
save_notes (gpointer data)
{
diff --git a/src/gr-edit-page.c b/src/gr-edit-page.c
index 997bf11..415855f 100644
--- a/src/gr-edit-page.c
+++ b/src/gr-edit-page.c
@@ -643,21 +643,6 @@ collect_ingredients (GrEditPage *page)
}
static void
-all_headers (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
-{
- GtkWidget *header;
-
- header = gtk_list_box_row_get_header (row);
- if (header)
- return;
-
- header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_list_box_row_set_header (row, header);
-}
-
-static void
show_ingredients_search_list (GrEditPage *self)
{
gtk_widget_hide (self->ing_search_button);
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index c443907..1641ba9 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -542,21 +542,6 @@ add_recipe_row (GrRecipeExporter *exporter,
}
-static void
-all_headers (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
-{
- GtkWidget *header;
-
- header = gtk_list_box_row_get_header (row);
- if (header)
- return;
-
- header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_list_box_row_set_header (row, header);
-}
-
static int
sort_recipe_row (GtkListBoxRow *row1,
GtkListBoxRow *row2,
diff --git a/src/gr-shopping-page.c b/src/gr-shopping-page.c
index f57d061..43f7f42 100644
--- a/src/gr-shopping-page.c
+++ b/src/gr-shopping-page.c
@@ -529,21 +529,6 @@ print_list (GrShoppingPage *page)
}
static void
-all_headers (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
-{
- GtkWidget *header;
-
- header = gtk_list_box_row_get_header (row);
- if (header)
- return;
-
- header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_list_box_row_set_header (row, header);
-}
-
-static void
gr_shopping_page_init (GrShoppingPage *page)
{
gtk_widget_set_has_window (GTK_WIDGET (page), FALSE);
diff --git a/src/gr-utils.c b/src/gr-utils.c
index 3fd55cf..5af3461 100644
--- a/src/gr-utils.c
+++ b/src/gr-utils.c
@@ -506,3 +506,18 @@ ensure_rotated_image (const char *path,
return g_strdup (rotated);
}
+
+void
+all_headers (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data)
+{
+ GtkWidget *header;
+
+ header = gtk_list_box_row_get_header (row);
+ if (header)
+ return;
+
+ header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ gtk_list_box_row_set_header (row, header);
+}
diff --git a/src/gr-utils.h b/src/gr-utils.h
index 07a2377..df54b59 100644
--- a/src/gr-utils.h
+++ b/src/gr-utils.h
@@ -62,3 +62,7 @@ void record_step (const char *blurb);
gboolean in_flatpak_sandbox (void);
gboolean portals_available (void);
+
+void all_headers (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]