From c615e430f8041c0284c4b3596c1201a9edba4a79 Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 9 Mar 2020 17:06:37 +0100 Subject: =?UTF-8?q?Remove=20warning:=20=E2=80=98GTimeVal=E2=80=99=20is=20d?= =?UTF-8?q?eprecated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gpm-statistics.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gpm-statistics.c') diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index 049035a..bba4081 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -502,8 +502,7 @@ gpm_stats_update_info_page_history (UpDevice *device) gboolean points; GpmPointObj *point; GPtrArray *new; - gint32 offset = 0; - GTimeVal timeval; + gint32 offset; new = g_ptr_array_new_with_free_func ((GDestroyNotify) gpm_point_obj_free); if (g_strcmp0 (history_type, GPM_HISTORY_CHARGE_VALUE) == 0) { @@ -550,8 +549,7 @@ gpm_stats_update_info_page_history (UpDevice *device) gtk_widget_hide (widget); gtk_widget_show (graph_history); - g_get_current_time (&timeval); - offset = timeval.tv_sec; + offset = (gint32) (g_get_real_time () / G_USEC_PER_SEC); for (i=0; ilen; i++) { item = (UpHistoryItem *) g_ptr_array_index (array, i); @@ -561,7 +559,7 @@ gpm_stats_update_info_page_history (UpDevice *device) continue; point = gpm_point_obj_new (); - point->x = (gint32) up_history_item_get_time (item) - offset; + point->x = ((gint32) up_history_item_get_time (item)) - offset; point->y = up_history_item_get_value (item); if (up_history_item_get_state (item) == UP_DEVICE_STATE_CHARGING) point->color = egg_color_from_rgb (255, 0, 0); -- cgit v1.2.1