summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-03-09 17:06:37 +0100
committerraveit65 <[email protected]>2020-03-25 13:15:24 +0100
commitc615e430f8041c0284c4b3596c1201a9edba4a79 (patch)
treefad8754a1a57a0488899a61516a7e581e61338f4 /src
parent46388fe8117ca3d52b9346100b14e9369e62008b (diff)
downloadmate-power-manager-c615e430f8041c0284c4b3596c1201a9edba4a79.tar.bz2
mate-power-manager-c615e430f8041c0284c4b3596c1201a9edba4a79.tar.xz
Remove warning: ‘GTimeVal’ is deprecated
Diffstat (limited to 'src')
-rw-r--r--src/gpm-statistics.c8
1 files changed, 3 insertions, 5 deletions
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; i<array->len; 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);