[recipes] Update most callers to use the store singleton
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Update most callers to use the store singleton
- Date: Sat, 11 Mar 2017 21:02:37 +0000 (UTC)
commit e84fd77bfc767e9f7b1aebe2693c779a914574be
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 11 15:49:39 2017 -0500
Update most callers to use the store singleton
src/gr-about-dialog.c | 2 +-
src/gr-account.c | 4 ++--
src/gr-chef-dialog.c | 6 +++---
src/gr-cuisine-page.c | 4 ++--
src/gr-cuisines-page.c | 4 ++--
src/gr-details-page.c | 14 +++++++-------
src/gr-edit-page.c | 8 ++++----
src/gr-list-page.c | 6 +++---
src/gr-recipe-exporter.c | 4 ++--
src/gr-recipe-formatter.c | 2 +-
src/gr-recipe-importer.c | 12 ++++++------
src/gr-recipe-printer.c | 2 +-
src/gr-recipe-small-tile.c | 4 ++--
src/gr-recipe-tile.c | 2 +-
src/gr-recipe.c | 2 +-
src/gr-recipes-page.c | 10 +++++-----
src/gr-search-page.c | 2 +-
src/gr-shopping-page.c | 20 ++++++++++----------
src/gr-window.c | 6 +++---
19 files changed, 57 insertions(+), 57 deletions(-)
---
diff --git a/src/gr-about-dialog.c b/src/gr-about-dialog.c
index 1f6194b..b4ffe6a 100644
--- a/src/gr-about-dialog.c
+++ b/src/gr-about-dialog.c
@@ -869,7 +869,7 @@ gr_about_dialog_new (void)
"website-label", _("Learn more about Recipes"),
NULL);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
recipe_authors = gr_recipe_store_get_contributors (store, &length);
g_qsort_with_data (recipe_authors, length, sizeof (char *), compare_strings, NULL);
gtk_about_dialog_add_credit_section (GTK_ABOUT_DIALOG (about),
diff --git a/src/gr-account.c b/src/gr-account.c
index fe48ec5..d49c327 100644
--- a/src/gr-account.c
+++ b/src/gr-account.c
@@ -205,7 +205,7 @@ got_account_info (const char *id,
g_autoptr(GrChef) chef = NULL;
g_autoptr(GError) local_error = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
if (error) {
g_info ("Failed to get account information: %s", error->message);
@@ -238,7 +238,7 @@ gr_ensure_user_chef (GtkWindow *window,
g_autoptr(GrChef) chef = NULL;
UserChefData *cbdata;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
chef = gr_recipe_store_get_chef (store, gr_recipe_store_get_user_key (store));
if (chef) {
diff --git a/src/gr-chef-dialog.c b/src/gr-chef-dialog.c
index 08da23d..e3dfa31 100644
--- a/src/gr-chef-dialog.c
+++ b/src/gr-chef-dialog.c
@@ -202,7 +202,7 @@ save_chef_dialog (GrChefDialog *self,
gtk_text_buffer_get_bounds (buffer, &start, &end);
description = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
if (id != NULL && id[0] != '\0'){
g_object_set (self->chef,
@@ -291,7 +291,7 @@ gr_chef_dialog_set_chef (GrChefDialog *self,
revert_changes (self);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
same_chef = self->chef != NULL && self->chef == chef;
@@ -433,7 +433,7 @@ populate_chef_list (GrChefDialog *dialog)
guint length;
int i;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
keys = gr_recipe_store_get_chef_keys (store, &length);
for (i = 0; keys[i]; i++) {
diff --git a/src/gr-cuisine-page.c b/src/gr-cuisine-page.c
index d49e208..9136fb1 100644
--- a/src/gr-cuisine-page.c
+++ b/src/gr-cuisine-page.c
@@ -253,7 +253,7 @@ gr_cuisine_page_set_cuisine (GrCuisinePage *self,
self->categories[i].filled = FALSE;
}
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
keys = gr_recipe_store_get_recipe_keys (store, &length);
for (j = 0; j < length; j++) {
@@ -308,7 +308,7 @@ connect_store_signals (GrCuisinePage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_signal_connect_swapped (store, "recipe-added", G_CALLBACK (cuisine_page_reload), page);
g_signal_connect_swapped (store, "recipe-removed", G_CALLBACK (cuisine_page_reload), page);
diff --git a/src/gr-cuisines-page.c b/src/gr-cuisines-page.c
index 602c361..a500905 100644
--- a/src/gr-cuisines-page.c
+++ b/src/gr-cuisines-page.c
@@ -107,7 +107,7 @@ populate_cuisines (GrCuisinesPage *page)
container_remove_all (GTK_CONTAINER (page->top_box));
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
all_cuisines = gr_cuisine_get_names (&length);
cuisines = g_new0 (char *, g_strv_length ((char **)all_cuisines) + 1);
@@ -246,7 +246,7 @@ connect_store_signals (GrCuisinesPage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_signal_connect_swapped (store, "recipe-added", G_CALLBACK (cuisines_page_reload), page);
g_signal_connect_swapped (store, "recipe-removed", G_CALLBACK (cuisines_page_reload), page);
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index a836012..fc7a48a 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -106,7 +106,7 @@ delete_recipe (GrDetailsPage *page)
recipe = g_object_ref (page->recipe);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gr_recipe_store_remove_recipe (store, page->recipe);
g_set_object (&page->recipe, NULL);
g_set_object (&page->chef, NULL);
@@ -196,7 +196,7 @@ cook_it_later (GrDetailsPage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page->favorite_button)))
gr_recipe_store_add_favorite (store, page->recipe);
else
@@ -210,7 +210,7 @@ shop_it (GrDetailsPage *page)
GtkWidget *window;
int serves;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
serves = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (page->serves_spin));
gr_recipe_store_add_to_shopping (store, page->recipe, serves);
@@ -266,7 +266,7 @@ save_notes (gpointer data)
g_object_set (page->recipe, "notes", text, NULL);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
if (!gr_recipe_store_update_recipe (store, page->recipe, id, &error)) {
g_warning ("Error: %s", error->message);
}
@@ -308,7 +308,7 @@ activate_uri_at_idle (gpointer data)
const char *id;
g_autoptr(GrRecipe) recipe = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
id = uri + strlen ("recipe:");
recipe = gr_recipe_store_get_recipe (store, id);
@@ -719,7 +719,7 @@ gr_details_page_set_recipe (GrDetailsPage *page,
gtk_spin_button_set_value (GTK_SPIN_BUTTON (page->serves_spin), want_serves);
gtk_widget_set_sensitive (page->serves_spin, ing != NULL);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
favorite = gr_recipe_store_is_favorite (store, recipe);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->favorite_button), favorite);
@@ -802,7 +802,7 @@ connect_store_signals (GrDetailsPage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_signal_connect_swapped (store, "recipe-changed", G_CALLBACK (details_page_reload), page);
}
diff --git a/src/gr-edit-page.c b/src/gr-edit-page.c
index 1cb41b8..20fce96 100644
--- a/src/gr-edit-page.c
+++ b/src/gr-edit-page.c
@@ -1283,7 +1283,7 @@ edit_chef (GrEditPage *page)
win = gtk_widget_get_ancestor (GTK_WIDGET (page), GTK_TYPE_APPLICATION_WINDOW);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
chef = gr_recipe_store_get_chef (store, page->author ? page->author : "");
@@ -1888,7 +1888,7 @@ gr_edit_page_clear (GrEditPage *page)
gr_image_viewer_revert_changes (GR_IMAGE_VIEWER (page->images));
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gtk_label_set_label (GTK_LABEL (page->name_label), _("Name Your Recipe"));
gtk_entry_set_text (GTK_ENTRY (page->name_entry), "");
@@ -2040,7 +2040,7 @@ gr_edit_page_edit (GrEditPage *page,
gr_image_viewer_revert_changes (GR_IMAGE_VIEWER (page->images));
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
name = gr_recipe_get_name (recipe);
serves = gr_recipe_get_serves (recipe);
@@ -2125,7 +2125,7 @@ gr_edit_page_save (GrEditPage *page)
GrDiets diets;
g_autoptr(GArray) images = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
name = gtk_entry_get_text (GTK_ENTRY (page->name_entry));
cuisine = get_combo_value (GTK_COMBO_BOX (page->cuisine_combo));
diff --git a/src/gr-list-page.c b/src/gr-list-page.c
index a554f55..b090e58 100644
--- a/src/gr-list-page.c
+++ b/src/gr-list-page.c
@@ -339,7 +339,7 @@ gr_list_page_populate_from_chef (GrListPage *self,
gtk_label_set_label (GTK_LABEL (self->heading), tmp);
g_free (tmp);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
container_remove_all (GTK_CONTAINER (self->flow_box));
tmp = g_strdup_printf (_("No recipes by chef %s found"), name);
@@ -462,7 +462,7 @@ gr_list_page_populate_from_list (GrListPage *self,
GList *l;
gboolean empty;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
recipes = g_list_copy_deep (recipes, (GCopyFunc)g_object_ref, NULL);
clear_data (self);
@@ -528,7 +528,7 @@ connect_store_signals (GrListPage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_signal_connect_swapped (store, "recipe-added", G_CALLBACK (repopulate), page);
g_signal_connect_swapped (store, "recipe-removed", G_CALLBACK (repopulate), page);
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index a6a5095..fe1a0aa 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -417,7 +417,7 @@ prepare_export (GrRecipeExporter *exporter,
g_autoptr(GHashTable) chefs = NULL;
g_autofree char *imagedir = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_assert (exporter->dir == NULL);
g_assert (exporter->sources == NULL);
@@ -770,7 +770,7 @@ collect_all_recipes (GrRecipeExporter *exporter)
guint length;
int i;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
keys = gr_recipe_store_get_recipe_keys (store, &length);
for (i = 0; keys[i]; i++) {
g_autoptr(GrRecipe) recipe = gr_recipe_store_get_recipe (store, keys[i]);
diff --git a/src/gr-recipe-formatter.c b/src/gr-recipe-formatter.c
index 374fa17..303a4a9 100644
--- a/src/gr-recipe-formatter.c
+++ b/src/gr-recipe-formatter.c
@@ -44,7 +44,7 @@ gr_recipe_format (GrRecipe *recipe)
int length;
g_autoptr(GPtrArray) steps = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
chef = gr_recipe_store_get_chef (store, gr_recipe_get_author (recipe));
s = g_string_new ("");
diff --git a/src/gr-recipe-importer.c b/src/gr-recipe-importer.c
index e669747..e424990 100644
--- a/src/gr-recipe-importer.c
+++ b/src/gr-recipe-importer.c
@@ -287,7 +287,7 @@ import_recipe (GrRecipeImporter *importer)
g_autofree char *id = NULL;
const char *author;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
images = gr_image_array_new ();
if (importer->recipe_paths) {
@@ -376,7 +376,7 @@ recipe_name_changed (GtkEntry *entry,
GtkWidget *dialog;
g_autoptr(GrRecipe) recipe = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
name = gtk_entry_get_text (entry);
author = (const char *)g_hash_table_lookup (importer->chef_id_map, importer->recipe_author);
@@ -435,7 +435,7 @@ import_next_recipe (GrRecipeImporter *importer)
g_autoptr(GError) error = NULL;
const char *id;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
next:
importer->current_recipe++;
@@ -539,7 +539,7 @@ import_chef (GrRecipeImporter *importer)
g_autoptr(GrChef) chef = NULL;
g_autoptr(GError) error = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
if (importer->chef_image_path) {
char *new_path;
@@ -581,7 +581,7 @@ find_unused_chef_id (const char *base)
GrRecipeStore *store;
int i;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
for (i = 0; i < 100; i++) {
g_autofree char *new_id = NULL;
@@ -708,7 +708,7 @@ import_next_chef (GrRecipeImporter *importer)
g_autoptr(GrChef) chef = NULL;
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
next:
importer->current_chef++;
diff --git a/src/gr-recipe-printer.c b/src/gr-recipe-printer.c
index 7ee7df0..3dd227a 100644
--- a/src/gr-recipe-printer.c
+++ b/src/gr-recipe-printer.c
@@ -123,7 +123,7 @@ begin_print (GtkPrintOperation *operation,
g_autoptr(GrChef) chef = NULL;
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
chef = gr_recipe_store_get_chef (store, gr_recipe_get_author (printer->recipe));
width = gtk_print_context_get_width (context);
diff --git a/src/gr-recipe-small-tile.c b/src/gr-recipe-small-tile.c
index 4fb234d..9fdc85f 100644
--- a/src/gr-recipe-small-tile.c
+++ b/src/gr-recipe-small-tile.c
@@ -80,7 +80,7 @@ recipe_small_tile_set_recipe (GrRecipeSmallTile *tile,
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_set_object (&tile->recipe, recipe);
@@ -137,7 +137,7 @@ remove_recipe (GrRecipeSmallTile *tile)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gr_recipe_store_remove_from_shopping (store, tile->recipe);
}
diff --git a/src/gr-recipe-tile.c b/src/gr-recipe-tile.c
index da7b255..390da26 100644
--- a/src/gr-recipe-tile.c
+++ b/src/gr-recipe-tile.c
@@ -61,7 +61,7 @@ recipe_tile_set_recipe (GrRecipeTile *tile,
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_set_object (&tile->recipe, recipe);
diff --git a/src/gr-recipe.c b/src/gr-recipe.c
index eed4f64..3eba0e3 100644
--- a/src/gr-recipe.c
+++ b/src/gr-recipe.c
@@ -265,7 +265,7 @@ gr_recipe_get_chef_fullname (GrRecipe *self)
GrRecipeStore *store;
g_autoptr(GrChef) chef = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
chef = gr_recipe_store_get_chef (store, self->author);
if (chef) {
const char *fullname = gr_chef_get_fullname (chef);
diff --git a/src/gr-recipes-page.c b/src/gr-recipes-page.c
index ad33241..d6ae13b 100644
--- a/src/gr-recipes-page.c
+++ b/src/gr-recipes-page.c
@@ -269,7 +269,7 @@ update_shopping_time (gpointer data)
GDateTime *change;
g_autoptr(GDateTime) now = NULL;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
now = g_date_time_new_now_utc ();
change = gr_recipe_store_last_shopping_change (store);
@@ -302,7 +302,7 @@ populate_recipes_from_store (GrRecipesPage *self)
container_remove_all (GTK_CONTAINER (self->today_box));
container_remove_all (GTK_CONTAINER (self->pick_box));
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
keys = gr_recipe_store_get_recipe_keys (store, &length);
@@ -360,7 +360,7 @@ populate_shopping_from_store (GrRecipesPage *self)
g_autofree char *shop2 = NULL;
char *tmp;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
keys = gr_recipe_store_get_recipe_keys (store, &length);
@@ -419,7 +419,7 @@ populate_chefs_from_store (GrRecipesPage *self)
container_remove_all (GTK_CONTAINER (self->chefs_box));
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
keys = gr_recipe_store_get_chef_keys (store, &length);
/* scramble the keys so we don't always get the same picks */
@@ -471,7 +471,7 @@ connect_store_signals (GrRecipesPage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_signal_connect_swapped (store, "recipe-added", G_CALLBACK (repopulate_recipes), page);
g_signal_connect_swapped (store, "recipe-removed", G_CALLBACK (repopulate_recipes), page);
diff --git a/src/gr-search-page.c b/src/gr-search-page.c
index 4e5f23f..4510d73 100644
--- a/src/gr-search-page.c
+++ b/src/gr-search-page.c
@@ -201,7 +201,7 @@ connect_store_signals (GrSearchPage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_signal_connect_swapped (store, "recipe-added", G_CALLBACK (search_page_reload), page);
g_signal_connect_swapped (store, "recipe-removed", G_CALLBACK (search_page_reload), page);
diff --git a/src/gr-shopping-page.c b/src/gr-shopping-page.c
index c89151d..afc2073 100644
--- a/src/gr-shopping-page.c
+++ b/src/gr-shopping-page.c
@@ -129,7 +129,7 @@ recount_recipes (GrShoppingPage *page)
if (count == 0) {
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gr_recipe_store_clear_shopping_list (store);
window = gtk_widget_get_ancestor (GTK_WIDGET (page), GTK_TYPE_APPLICATION_WINDOW);
@@ -162,7 +162,7 @@ ingredient_new (const char *ingredient)
Ingredient *ing;
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
ing = g_new0 (Ingredient, 1);
ing->ingredient = g_strdup (ingredient);
@@ -279,7 +279,7 @@ remove_ingredient (GtkButton *button, GrShoppingPage *page)
Ingredient *ing;
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
row = gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_LIST_BOX_ROW);
@@ -404,7 +404,7 @@ removed_row_activated (GtkListBox *list,
Ingredient *ing;
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
popover = gtk_widget_get_ancestor (GTK_WIDGET (row), GTK_TYPE_POPOVER);
gtk_popover_popdown (GTK_POPOVER (popover));
@@ -524,7 +524,7 @@ serves_changed (GObject *object, GParamSpec *pspec, GrShoppingPage *page)
recipe = gr_recipe_small_tile_get_recipe (tile);
serves = gr_recipe_small_tile_get_serves (tile);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gr_recipe_store_add_to_shopping (store, recipe, serves);
}
@@ -545,7 +545,7 @@ search_hits_added (GrRecipeSearch *search,
GrRecipeStore *store;
GList *l;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
for (l = hits; l; l = l->next) {
GrRecipe *recipe = l->data;
@@ -597,7 +597,7 @@ clear_list (GrShoppingPage *page)
GrRecipeStore *store;
GtkWidget *window;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
container_remove_all (GTK_CONTAINER (page->ingredients_list));
container_remove_all (GTK_CONTAINER (page->removed_list));
@@ -909,7 +909,7 @@ recipe_added (GrShoppingPage *page,
if (!gtk_widget_is_drawable (GTK_WIDGET (page)))
return;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
serves = gr_recipe_store_get_shopping_serves (store, recipe);
@@ -946,7 +946,7 @@ recipe_changed (GrShoppingPage *page,
if (!gtk_widget_is_drawable (GTK_WIDGET (page)))
return;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
if (gr_recipe_store_is_in_shopping (store, recipe))
recipe_added (page, recipe);
@@ -959,7 +959,7 @@ connect_store_signals (GrShoppingPage *page)
{
GrRecipeStore *store;
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
g_signal_connect_swapped (store, "recipe-removed", G_CALLBACK (recipe_removed), page);
g_signal_connect_swapped (store, "recipe-changed", G_CALLBACK (recipe_changed), page);
diff --git a/src/gr-window.c b/src/gr-window.c
index 6008bf5..7f17340 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -586,7 +586,7 @@ do_undo (GrWindow *window)
recipe = g_object_ref (window->undo_recipe);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gr_recipe_store_add_recipe (store, window->undo_recipe, NULL);
close_undo (window);
@@ -767,7 +767,7 @@ done_shopping (GrWindow *window)
g_list_free_full (recipes, g_object_unref);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gr_recipe_store_clear_shopping_list (store);
}
@@ -1279,7 +1279,7 @@ gr_window_show_myself (GrWindow *window)
save_back_entry (window);
- store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
+ store = gr_recipe_store_get ();
gr_ensure_user_chef (GTK_WINDOW (window), do_show_myself, window);
name = gr_recipe_store_get_user_key (store);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]