[recipes] Revert "Fix deprecation warnings for use of GTimeVal"



commit 058b233119927943def745472718569d39887b17
Author: Matthew Leeds <matthew leeds endlessm com>
Date:   Sun Mar 22 15:48:11 2020 -0700

    Revert "Fix deprecation warnings for use of GTimeVal"
    
    This reverts commit 64ad62346876fb79987e96ecb9b9eaf5d1790647.
    
    Gitlab somehow squashed commits together that weren't fixups...

 data/recipes.db                 |  2 +-
 meson.build                     |  6 +++---
 src/gr-cooking-view.c           |  2 +-
 src/gr-edit-page.c              |  2 +-
 src/gr-image-viewer.c           |  2 +-
 src/gr-image.c                  | 15 +++++++++------
 src/gr-ingredients-viewer-row.c |  2 +-
 src/gr-recipe-store.c           | 15 +++++++++------
 8 files changed, 26 insertions(+), 20 deletions(-)
---
diff --git a/data/recipes.db b/data/recipes.db
index 89dd8ec..64dddd1 100644
--- a/data/recipes.db
+++ b/data/recipes.db
@@ -31,7 +31,7 @@ Season=
 Category=Sauce
 PrepTime=Less than 15 minutes
 CookTime=
-Ingredients=1          Cucumber        Ingredients\n2  Cloves  Garlic Minced   Ingredients\n¼  cup     Extra 
Virgin Olive Oil  Ingredients\n18 oz      Strained Greek yogurt   Ingredients\n2  tbsp    Red wine vinegar    
    Ingredients\n1  pinch   Salt and pepper Ingredients
+Ingredients=1          Cucumber        Ingredients\n2  Cloves  Garlic Minced   Ingredients\n¼  cup     Extra 
Virgin Olive Oil  Ingredients\n18 oz      Strained Greek yogurt   Ingredients\n2  tbsp    Red wine vinegar    
    Ingredients\n1  pinch   Salt and pepper Ingredients\n
 Instructions=To prepare this traditional Greek tzatziki sauce recipe, remove the skin and the seeds of the 
cucumber and grate it into a large bowl. Season with salt and pepper and leave aside for 10 minutes.\n\n    
Wrap the grated cucumber in a towel and squeeze, in order to get rid of the excess water.\n\n    Assemble the 
tzatziki sauce. In a bowl, add the cucumber, the minced garlic and olive oil, the yogurt, 1-2 tbsps of red 
wine vinegar, a pinch of salt and blend, until the ingredients are combined. Store the tzatziki sauce in the 
fridge and always serve cold. (Alternatively, if you have a blender, pour in the olive oil and garlic and 
blend until combined. Then mix with the rest of the ingredients using a spoon. This will help the garlic to 
mix better with the rest of the ingredients).\n\n    Prepare this traditional tzatziki sauce for your friends 
and family and serve as a delicious dip with some warm pita breads aside, or as a sauce for Greek-style 
souvlaki. Enjoy!
 Notes=
 Serves=4
diff --git a/meson.build b/meson.build
index a0edaad..bb42cf8 100644
--- a/meson.build
+++ b/meson.build
@@ -81,9 +81,9 @@ if get_option('canberra') != 'no'
 endif
 
 deps = [ dependency('gtk+-3.0', version : '>=3.22'),
-         dependency('glib-2.0', version : '>= 2.61.2'),
-         dependency('gio-2.0', version : '>= 2.61.2'),
-         dependency('gio-unix-2.0', version : '>= 2.61.2'),
+         dependency('glib-2.0'),
+         dependency('gio-2.0'),
+         dependency('gio-unix-2.0'),
          dependency('gmodule-export-2.0'),
          dependency('libsoup-2.4'),
          dependency('goa-1.0'),
diff --git a/src/gr-cooking-view.c b/src/gr-cooking-view.c
index 709a1b6..ed1ca6b 100644
--- a/src/gr-cooking-view.c
+++ b/src/gr-cooking-view.c
@@ -663,7 +663,7 @@ gr_cooking_view_stop (GrCookingView *view,
                 container_remove_all (GTK_CONTAINER (view->timer_box));
 
         g_clear_pointer (&view->instructions, g_free);
-        g_clear_pointer (&view->images, g_ptr_array_unref);
+        g_clear_pointer (&view->images, g_array_unref);
         g_ptr_array_set_size (view->steps, 0);
 
         if (stop_timers) {
diff --git a/src/gr-edit-page.c b/src/gr-edit-page.c
index a025623..856680a 100644
--- a/src/gr-edit-page.c
+++ b/src/gr-edit-page.c
@@ -946,7 +946,7 @@ get_units_model (GrEditPage *page)
                                                    -1);
         }
 
-        return GTK_TREE_MODEL (g_object_ref (store));
+        return g_object_ref (store);
 }
 
 static gboolean
diff --git a/src/gr-image-viewer.c b/src/gr-image-viewer.c
index aeedeb2..34355df 100644
--- a/src/gr-image-viewer.c
+++ b/src/gr-image-viewer.c
@@ -127,7 +127,7 @@ gr_image_viewer_finalize (GObject *object)
         g_clear_pointer (&viewer->additions, g_ptr_array_unref);
         g_clear_pointer (&viewer->removals, g_ptr_array_unref);
 
-        g_clear_pointer (&viewer->images, g_ptr_array_unref);
+        g_clear_pointer (&viewer->images, g_array_unref);
         remove_hide_timeout (viewer);
         g_clear_object (&viewer->gesture);
 
diff --git a/src/gr-image.c b/src/gr-image.c
index 4b1d084..1f12815 100644
--- a/src/gr-image.c
+++ b/src/gr-image.c
@@ -235,15 +235,17 @@ should_try_load (const char *path)
                                   G_FILE_QUERY_INFO_NONE,
                                   NULL,
                                   NULL);
-        if (info &&
-            g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) {
+        if (info) {
                 goffset size;
+                GTimeVal tv;
                 g_autoptr(GDateTime) now = NULL;
                 g_autoptr(GDateTime) mtime = NULL;
 
                 size = g_file_info_get_size (info);
+                g_file_info_get_modification_time (info, &tv);
+
                 now = g_date_time_new_now_utc ();
-                mtime = g_file_info_get_modification_date_time (info);
+                mtime = g_date_time_new_from_timeval_utc (&tv);
 
                 if (size == 6) {
                         result = g_date_time_difference (now, mtime) > G_TIME_SPAN_DAY;
@@ -295,12 +297,13 @@ set_modified_request (SoupMessage *msg,
                                   G_FILE_QUERY_INFO_NONE,
                                   NULL,
                                   NULL);
-        if (info &&
-            g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) {
+        if (info) {
+                GTimeVal tv;
                 g_autoptr(GDateTime) mtime = NULL;
                 g_autofree char *mod_date = NULL;
 
-                mtime = g_file_info_get_modification_date_time (info);
+                g_file_info_get_modification_time (info, &tv);
+                mtime = g_date_time_new_from_timeval_utc (&tv);
                 mod_date = g_date_time_format (mtime, "%a, %d %b %Y %H:%M:%S %Z");
                 soup_message_headers_append (msg->request_headers, "If-Modified-Since", mod_date);
         }
diff --git a/src/gr-ingredients-viewer-row.c b/src/gr-ingredients-viewer-row.c
index bea7376..2723053 100644
--- a/src/gr-ingredients-viewer-row.c
+++ b/src/gr-ingredients-viewer-row.c
@@ -764,7 +764,7 @@ get_units_model (GrIngredientsViewerRow *row)
                 }
         }
 
-        return GTK_TREE_MODEL (g_object_ref (store));
+        return g_object_ref (store);
 }
 
 static void
diff --git a/src/gr-recipe-store.c b/src/gr-recipe-store.c
index 3c6d7ca..c7f4e84 100644
--- a/src/gr-recipe-store.c
+++ b/src/gr-recipe-store.c
@@ -991,13 +991,15 @@ should_try_load (const char *path)
                                   G_FILE_QUERY_INFO_NONE,
                                   NULL,
                                   NULL);
-        if (info &&
-            g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) {
+        if (info) {
+                GTimeVal tv;
                 g_autoptr(GDateTime) now = NULL;
                 g_autoptr(GDateTime) mtime = NULL;
 
+                g_file_info_get_modification_time (info, &tv);
+
                 now = g_date_time_new_now_utc ();
-                mtime = g_file_info_get_modification_date_time (info);
+                mtime = g_date_time_new_from_timeval_utc (&tv);
 
                 result = g_date_time_difference (now, mtime) > G_TIME_SPAN_DAY;
                 g_debug ("Cached file for %s is %s",
@@ -1014,6 +1016,7 @@ set_modified_request (SoupMessage *msg,
 {
         g_autoptr(GFile) file = NULL;
         g_autoptr(GFileInfo) info = NULL;
+        GTimeVal tv;
         g_autoptr(GDateTime) mtime = NULL;
         g_autofree char *mod_date = NULL;
 
@@ -1024,9 +1027,9 @@ set_modified_request (SoupMessage *msg,
                                   NULL,
                                   NULL);
 
-        if (info &&
-            g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) {
-                mtime = g_file_info_get_modification_date_time (info);
+        if (info) {
+                g_file_info_get_modification_time (info, &tv);
+                mtime = g_date_time_new_from_timeval_utc (&tv);
                 mod_date = g_date_time_format (mtime, "%a, %d %b %Y %H:%M:%S %Z");
                 soup_message_headers_append (msg->request_headers, "If-Modified-Since", mod_date);
         }


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