mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-07 11:58:07 +02:00
all: convert value from g_get_real_time() to seconds
Commit 5ddfe0d (all: Use g_get_real_time() when possible) replaced calls
to g_get_current_time() with g_get_real_time(), however, we also need to
convert the return value from microseconds to seconds.
Signed-off-by: Richard Hughes <richard@hughsie.com>
This commit is contained in:
parent
5ddfe0dba1
commit
bbe15b14de
10 changed files with 12 additions and 12 deletions
|
|
@ -73,7 +73,7 @@ up_backend_changed_time_cb (UpBackend *backend)
|
|||
device = NULL;
|
||||
|
||||
/* reset time */
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ up_device_supply_refresh (UpDevice *device)
|
|||
}
|
||||
|
||||
if (ret)
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ up_device_csr_refresh (UpDevice *device)
|
|||
}
|
||||
|
||||
/* reset time */
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
|
||||
/* success */
|
||||
ret = TRUE;
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ up_device_hid_refresh (UpDevice *device)
|
|||
up_device_hid_fixup_state (device);
|
||||
|
||||
/* reset time */
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ up_device_idevice_refresh (UpDevice *device)
|
|||
plist_free (dict);
|
||||
|
||||
/* reset time */
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
|
||||
retval = TRUE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1109,7 +1109,7 @@ up_device_supply_refresh (UpDevice *device)
|
|||
|
||||
/* reset time if we got new data */
|
||||
if (ret)
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ up_device_unifying_refresh (UpDevice *device)
|
|||
"is-present", hidpp_device_is_reachable (priv->hidpp_device),
|
||||
"percentage", (gdouble) hidpp_device_get_batt_percentage (priv->hidpp_device),
|
||||
"state", state,
|
||||
"update-time", (guint64) g_get_real_time (),
|
||||
"update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC,
|
||||
NULL);
|
||||
out:
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ up_device_wup_refresh (UpDevice *device)
|
|||
}
|
||||
|
||||
/* reset time */
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
|
||||
out:
|
||||
g_free (data);
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ up_apm_device_refresh(UpDevice* device)
|
|||
}
|
||||
|
||||
if (ret)
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time (), NULL);
|
||||
g_object_set (device, "update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -601,7 +601,7 @@ up_backend_init (UpBackend *backend)
|
|||
}
|
||||
|
||||
/* setup dummy */
|
||||
current_time = g_get_real_time ();
|
||||
current_time = g_get_real_time () / G_USEC_PER_SEC;
|
||||
g_object_set (backend->priv->battery,
|
||||
"type", UP_DEVICE_KIND_BATTERY,
|
||||
"power-supply", TRUE,
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ out:
|
|||
"percentage", percentage_total,
|
||||
"is-present", is_present_total,
|
||||
"power-supply", TRUE,
|
||||
"update-time", (guint64) g_get_real_time (),
|
||||
"update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC,
|
||||
NULL);
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -757,7 +757,7 @@ up_daemon_set_warning_level (UpDaemon *daemon, UpDeviceLevel warning_level)
|
|||
|
||||
g_object_set (G_OBJECT (daemon->priv->display_device),
|
||||
"warning-level", warning_level,
|
||||
"update-time", (guint64) g_get_real_time (),
|
||||
"update-time", (guint64) g_get_real_time () / G_USEC_PER_SEC,
|
||||
NULL);
|
||||
|
||||
if (daemon->priv->warning_level == UP_DEVICE_LEVEL_ACTION) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue