aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index 2a10290..bcd88ff 100644
--- a/src/service.c
+++ b/src/service.c
@@ -37,6 +37,15 @@ G_DEFINE_TYPE (IndicatorSessionService,
indicator_session_service,
G_TYPE_OBJECT)
+/* signals enum */
+enum
+{
+ NAME_LOST,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
enum
{
PROP_0,
@@ -910,9 +919,13 @@ on_name_lost (GDBusConnection * connection G_GNUC_UNUSED,
const gchar * name,
gpointer gself)
{
+ IndicatorSessionService * self = INDICATOR_SESSION_SERVICE (gself);
+
g_debug ("%s %s name lost %s", G_STRLOC, G_STRFUNC, name);
- unexport (INDICATOR_SESSION_SERVICE (gself));
+ unexport (self);
+
+ g_signal_emit (self, signals[NAME_LOST], 0, NULL);
}
/***
@@ -1133,6 +1146,14 @@ indicator_session_service_class_init (IndicatorSessionServiceClass * klass)
g_type_class_add_private (klass, sizeof (IndicatorSessionServicePrivate));
+ signals[NAME_LOST] = g_signal_new (INDICATOR_SESSION_SERVICE_SIGNAL_NAME_LOST,
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (IndicatorSessionServiceClass, name_lost),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
properties[PROP_0] = NULL;
properties[PROP_REPLACE] = g_param_spec_boolean ("replace",