summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-29 12:58:44 +0100
committerrbuj <[email protected]>2021-11-29 13:23:41 +0100
commitea3f3e9315e46e58bb699d23cfe31819c3c9f8a2 (patch)
tree9fff3b59676cbe0ebd828242bf0d4cfdf1aa5564
parent794c0d0c63e652f3ca82400b2fdd83fe4e58c02c (diff)
downloadmate-screensaver-floaters-GTimeVal.tar.bz2
mate-screensaver-floaters-GTimeVal.tar.xz
gs-listener-dbus: GTimeVal deprecationfloaters-GTimeVal
-rw-r--r--src/gs-listener-dbus.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gs-listener-dbus.c b/src/gs-listener-dbus.c
index 0bbd17e..e6205f0 100644
--- a/src/gs-listener-dbus.c
+++ b/src/gs-listener-dbus.c
@@ -106,7 +106,7 @@ typedef struct
char *connection;
guint32 cookie;
guint32 foreign_cookie;
- GTimeVal since;
+ gint64 since;
} GSListenerRefEntry;
enum
@@ -830,10 +830,12 @@ accumulate_ref_entry (gpointer key,
GSListenerRefEntry *entry,
DBusMessageIter *iter)
{
+ GDateTime *dt;
char *description;
char *time;
- time = g_time_val_to_iso8601 (&entry->since);
+ dt = g_date_time_new_from_unix_local (entry->since);
+ time = g_date_time_format_iso8601 (dt);
description = g_strdup_printf ("Application=\"%s\"; Since=\"%s\"; Reason=\"%s\";",
entry->application,
@@ -844,6 +846,7 @@ accumulate_ref_entry (gpointer key,
g_free (description);
g_free (time);
+ g_date_time_unref (dt);
}
static DBusHandlerResult
@@ -906,7 +909,7 @@ listener_add_ck_ref_entry (GSListener *listener,
entry->cookie = listener_generate_unique_key (listener, entry_type);
entry->application = g_strdup ("ConsoleKit");
entry->reason = g_strdup ("Session is not active");
- g_get_current_time (&entry->since);
+ entry->since = g_get_real_time () / G_USEC_PER_SEC;
/* takes ownership of entry */
listener_add_ref_entry (listener, entry_type, entry);
@@ -973,7 +976,7 @@ listener_dbus_add_ref_entry (GSListener *listener,
entry->cookie = listener_generate_unique_key (listener, entry_type);
entry->application = g_strdup (application);
entry->reason = g_strdup (reason);
- g_get_current_time (&entry->since);
+ entry->since = g_get_real_time () / G_USEC_PER_SEC;
listener_add_ref_entry (listener, entry_type, entry);