shared-macros.mk: simplify java settings
[oi-userland.git] / components / library / ConsoleKit / patches / 27-suspend-logging.patch
blob3a9ffd48c413bb18262f16600670496a0b847642
1 Import logging changes from
3 commit 27d081f9d39a9dff885598a6bb22c85ee18c732d
4 Author: Eric Koegel <eric.koegel@gmail.com>
5 Date: Mon Oct 27 08:58:53 2014 +0300
7 Refactor the system action code
9 This patch reduces some of the copy/paste code in all the system
10 actions of the manager. It also fills in the logging events for
11 the suspend and hibernate types.
13 diff --git a/src/ck-log-event.c b/src/ck-log-event.c
14 index 2bbb205..750a9d1 100644
15 --- a/src/ck-log-event.c
16 +++ b/src/ck-log-event.c
17 @@ -67,6 +67,18 @@ event_system_start_free (CkLogSystemStartEvent *event)
18 g_free (event->boot_arguments);
21 +static void
22 +event_system_suspend_free (CkLogSystemSuspendEvent *event)
24 + g_assert (event != NULL);
27 +static void
28 +event_system_hibernate_free (CkLogSystemHibernateEvent *event)
30 + g_assert (event != NULL);
33 static void
34 event_seat_session_added_free (CkLogSeatSessionAddedEvent *event)
36 @@ -203,6 +215,22 @@ event_system_start_copy (CkLogSystemStartEvent *event,
37 event_copy->boot_arguments = g_strdup (event->boot_arguments);
40 +static void
41 +event_system_suspend_copy (CkLogSystemSuspendEvent *event,
42 + CkLogSystemSuspendEvent *event_copy)
44 + g_assert (event != NULL);
45 + g_assert (event_copy != NULL);
48 +static void
49 +event_system_hibernate_copy (CkLogSystemHibernateEvent *event,
50 + CkLogSystemHibernateEvent *event_copy)
52 + g_assert (event != NULL);
53 + g_assert (event_copy != NULL);
56 static void
57 event_seat_session_added_copy (CkLogSeatSessionAddedEvent *event,
58 CkLogSeatSessionAddedEvent *event_copy)
59 @@ -311,6 +339,14 @@ ck_log_event_copy (CkLogEvent *event)
60 event_system_start_copy ((CkLogSystemStartEvent *) event,
61 (CkLogSystemStartEvent *) event_copy);
62 break;
63 + case CK_LOG_EVENT_SYSTEM_SUSPEND:
64 + event_system_suspend_copy ((CkLogSystemSuspendEvent *) event,
65 + (CkLogSystemSuspendEvent *) event_copy);
66 + break;
67 + case CK_LOG_EVENT_SYSTEM_HIBERNATE:
68 + event_system_hibernate_copy ((CkLogSystemHibernateEvent *) event,
69 + (CkLogSystemHibernateEvent *) event_copy);
70 + break;
71 case CK_LOG_EVENT_SEAT_SESSION_ADDED:
72 event_seat_session_added_copy ((CkLogSeatSessionAddedEvent *) event,
73 (CkLogSeatSessionAddedEvent *) event_copy);
74 @@ -358,6 +394,12 @@ ck_log_event_free (CkLogEvent *event)
75 case CK_LOG_EVENT_SYSTEM_START:
76 event_system_start_free ((CkLogSystemStartEvent *) event);
77 break;
78 + case CK_LOG_EVENT_SYSTEM_SUSPEND:
79 + event_system_suspend_free ((CkLogSystemSuspendEvent *) event);
80 + break;
81 + case CK_LOG_EVENT_SYSTEM_HIBERNATE:
82 + event_system_hibernate_free ((CkLogSystemHibernateEvent *) event);
83 + break;
84 case CK_LOG_EVENT_SEAT_SESSION_ADDED:
85 event_seat_session_added_free ((CkLogSeatSessionAddedEvent *) event);
86 break;
87 @@ -477,6 +519,20 @@ add_log_for_system_start (GString *str,
88 e->boot_arguments ? e->boot_arguments : "");
91 +static void
92 +add_log_for_system_suspend (GString *str,
93 + CkLogEvent *event)
95 + /* TODO: Not implemented */
98 +static void
99 +add_log_for_system_hibernate (GString *str,
100 + CkLogEvent *event)
102 + /* TODO: Not implemented */
105 static void
106 add_log_for_seat_active_session_changed (GString *str,
107 CkLogEvent *event)
108 @@ -629,6 +685,12 @@ ck_log_event_to_string (CkLogEvent *event,
109 case CK_LOG_EVENT_SYSTEM_START:
110 add_log_for_system_start (str, event);
111 break;
112 + case CK_LOG_EVENT_SYSTEM_SUSPEND:
113 + add_log_for_system_suspend (str, event);
114 + break;
115 + case CK_LOG_EVENT_SYSTEM_HIBERNATE:
116 + add_log_for_system_hibernate (str, event);
117 + break;
118 case CK_LOG_EVENT_SEAT_SESSION_ADDED:
119 add_log_for_seat_session_added (str, event);
120 break;
121 diff --git a/src/ck-log-event.h b/src/ck-log-event.h
122 index dd307f7..128e516 100644
123 --- a/src/ck-log-event.h
124 +++ b/src/ck-log-event.h
125 @@ -66,6 +66,16 @@ typedef struct
126 char *boot_arguments;
127 } CkLogSystemStartEvent;
129 +typedef struct
131 + gpointer dummy;
132 +} CkLogSystemSuspendEvent;
134 +typedef struct
136 + gpointer dummy;
137 +} CkLogSystemHibernateEvent;
139 typedef struct
141 char *seat_id;