From 8ac99de62c20044c52e7e21895166d995f0b0821 Mon Sep 17 00:00:00 2001 From: Olivier Duchateau Date: Tue, 5 May 2020 19:26:20 +0200 Subject: [PATCH] Fix GTimeVal deprecation --- panel-plugin/notification-plugin-log.c | 11 ++++------- xfce4-notifyd-config/main.c | 12 +++++------- xfce4-notifyd/xfce-notify-window.c | 6 +++--- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/panel-plugin/notification-plugin-log.c b/panel-plugin/notification-plugin-log.c index 4f03ba3..b6ba510 100644 --- a/panel-plugin/notification-plugin-log.c +++ b/panel-plugin/notification-plugin-log.c @@ -195,7 +195,6 @@ notification_plugin_menu_populate (NotificationPlugin *notification_plugin) gchar *app_name; gchar *tooltip_timestamp = NULL; gchar *tmp; - GTimeVal tv; GDateTime *log_timestamp; /* optionally only show notifications from today */ @@ -211,12 +210,10 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS mi = gtk_image_menu_item_new (); G_GNUC_END_IGNORE_DEPRECATIONS - if (g_time_val_from_iso8601 (group, &tv) == TRUE) { - log_timestamp = g_date_time_new_from_timeval_local (&tv); - if (log_timestamp != NULL) { - tooltip_timestamp = g_date_time_format (log_timestamp, "%c"); - g_date_time_unref(log_timestamp); - } + log_timestamp = g_date_time_new_from_iso8601 (group, NULL); + if (log_timestamp != NULL) { + tooltip_timestamp = g_date_time_format (log_timestamp, "%c"); + g_date_time_unref (log_timestamp); } app_name = g_key_file_get_string (notify_log, group, "app_name", NULL); diff --git a/xfce4-notifyd-config/main.c b/xfce4-notifyd-config/main.c index 585d6b8..a65e7ec 100644 --- a/xfce4-notifyd-config/main.c +++ b/xfce4-notifyd-config/main.c @@ -573,15 +573,13 @@ xfce4_notifyd_log_populate (NotificationLogWidgets *log_widgets) gchar *app_name; gchar *tooltip_timestamp = NULL; gchar *tmp; - GTimeVal tv; GDateTime *log_timestamp; - if (g_time_val_from_iso8601 (group, &tv) == TRUE) { - log_timestamp = g_date_time_new_from_timeval_local (&tv); - if (log_timestamp != NULL) { - tooltip_timestamp = g_date_time_format (log_timestamp, "%c"); - g_date_time_unref(log_timestamp); - } + log_timestamp = g_date_time_new_from_iso8601 (group, NULL); + if (log_timestamp != NULL) { + tooltip_timestamp = g_date_time_format (log_timestamp, + "%c"); + g_date_time_unref (log_timestamp); } if (g_ascii_strncasecmp (timestamp, group, 10) == 0 && yesterday == FALSE) { diff --git a/xfce4-notifyd/xfce-notify-window.c b/xfce4-notifyd/xfce-notify-window.c index d7235d4..72027d4 100644 --- a/xfce4-notifyd/xfce-notify-window.c +++ b/xfce4-notifyd/xfce-notify-window.c @@ -305,11 +305,11 @@ static void xfce_notify_window_start_expiration(XfceNotifyWindow *window) { if(window->expire_timeout) { - GTimeVal ct; + gint64 ct; guint timeout; gboolean fade_transparent; - g_get_current_time(&ct); + ct = g_get_real_time(); fade_transparent = gdk_screen_is_composited(gtk_window_get_screen(GTK_WINDOW (window))); @@ -321,7 +321,7 @@ xfce_notify_window_start_expiration(XfceNotifyWindow *window) else timeout = FADE_TIME; - window->expire_start_timestamp = ct.tv_sec * 1000 + ct.tv_usec / 1000; + window->expire_start_timestamp = ct / 1000; window->expire_id = g_timeout_add(timeout, xfce_notify_window_expire_timeout, window); -- 2.25.4