[gnome-desktop/ebassi/update-for-gtk4: 2/22] Replace deprecated use of GTimeVal




commit cf27647af1cecc9c1fab27c95f2d6f368cca2d01
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Oct 26 17:12:21 2021 +0100

    Replace deprecated use of GTimeVal
    
    GTimeVal is not year 2038 safe, and it has been deprecated in GLib.

 libgnome-desktop/gnome-bg-slide-show.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/libgnome-desktop/gnome-bg-slide-show.c b/libgnome-desktop/gnome-bg-slide-show.c
index ee3a5d54..97efde30 100644
--- a/libgnome-desktop/gnome-bg-slide-show.c
+++ b/libgnome-desktop/gnome-bg-slide-show.c
@@ -491,11 +491,7 @@ find_best_size (GSList *sizes, gint width, gint height)
 static double
 now (void)
 {
-       GTimeVal tv;
-
-       g_get_current_time (&tv);
-
-       return (double)tv.tv_sec + (tv.tv_usec / 1000000.0);
+        return (double) g_get_real_time () / 1000000.0;
 }
 
 /**
@@ -521,7 +517,7 @@ gnome_bg_slide_show_get_current_slide (GnomeBGSlideShow  *self,
                                        const char       **file1,
                                        const char       **file2)
 {
-       double delta = fmod (now() - self->priv->start_time, self->priv->total_duration);
+       double delta = fmod (now () - self->priv->start_time, self->priv->total_duration);
        GList *list;
        double elapsed;
        int i;
@@ -589,7 +585,7 @@ gnome_bg_slide_show_get_slide (GnomeBGSlideShow  *self,
                                const char       **file1,
                                const char       **file2)
 {
-       double delta = fmod (now() - self->priv->start_time, self->priv->total_duration);
+       double delta = fmod (now () - self->priv->start_time, self->priv->total_duration);
         GList *l;
         int i, skipped;
         gboolean found;


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