Commit 8226d00f authored by Sean Davis's avatar Sean Davis 🕶

Fix the remaining GTimeVal deprecations

parent 6f981a65
......@@ -870,10 +870,17 @@ static gdouble
screen_saver_get_timestamp (ScreenSaver *screen_saver) {
const gdouble microseconds_per_second = (gdouble ) G_USEC_PER_SEC;
gdouble timestamp;
GTimeVal now = { 0L, /* zero-filled */ };
GDateTime *now;
gdouble now_sec;
gint now_usec;
g_get_current_time (&now);
timestamp = ((microseconds_per_second * now.tv_sec) + now.tv_usec) /
now = g_date_time_new_now_local ();
now_sec = g_date_time_to_unix (now);
now_usec = g_date_time_get_microsecond (now);
g_date_time_unref (now);
timestamp = ((microseconds_per_second * now_sec) + now_usec) /
microseconds_per_second;
return timestamp;
......
......@@ -1048,11 +1048,17 @@ struct _SlideShow {
static double
now (void) {
GTimeVal tv;
GDateTime *tv;
gdouble tv_sec;
gint tv_usec;
g_get_current_time (&tv);
tv = g_date_time_new_now_local ();
tv_sec = g_date_time_to_unix (tv);
tv_usec = g_date_time_get_microsecond (tv);
return (double)tv.tv_sec + (tv.tv_usec / 1000000.0);
g_date_time_unref (tv);
return (double)tv_sec + (tv_usec / 1000000.0);
}
static Slide *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment