aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend-dbus/actions.c14
-rw-r--r--src/backend-dbus/actions.h4
-rw-r--r--src/backend-dbus/guest.c14
-rw-r--r--src/backend-dbus/guest.h4
-rw-r--r--src/backend-dbus/users.c14
-rw-r--r--src/backend-dbus/users.h4
-rw-r--r--src/recoverable-problem.c4
-rw-r--r--src/service.c12
8 files changed, 23 insertions, 47 deletions
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c
index 8ca05bf..f1c2498 100644
--- a/src/backend-dbus/actions.c
+++ b/src/backend-dbus/actions.c
@@ -47,7 +47,7 @@ enum
END_SESSION_TYPE_REBOOT
};
-struct _IndicatorSessionActionsDbusPriv
+struct _IndicatorSessionActionsDbusPrivate
{
GCancellable * cancellable;
@@ -70,11 +70,9 @@ struct _IndicatorSessionActionsDbusPriv
gboolean seat_allows_activation;
};
-typedef IndicatorSessionActionsDbusPriv priv_t;
+typedef IndicatorSessionActionsDbusPrivate priv_t;
-G_DEFINE_TYPE (IndicatorSessionActionsDbus,
- indicator_session_actions_dbus,
- INDICATOR_TYPE_SESSION_ACTIONS)
+G_DEFINE_TYPE_WITH_PRIVATE(IndicatorSessionActionsDbus, indicator_session_actions_dbus, INDICATOR_TYPE_SESSION_ACTIONS)
/***
****
@@ -1334,8 +1332,6 @@ indicator_session_actions_dbus_class_init (IndicatorSessionActionsDbusClass * kl
actions_class->switch_to_greeter = my_switch_to_greeter;
actions_class->switch_to_guest = my_switch_to_guest;
actions_class->switch_to_username = my_switch_to_username;
-
- g_type_class_add_private (klass, sizeof (IndicatorSessionActionsDbusPriv));
}
static void
@@ -1345,9 +1341,7 @@ indicator_session_actions_dbus_init (IndicatorSessionActionsDbus * self)
priv_t * p;
GSettings * s;
- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
- INDICATOR_TYPE_SESSION_ACTIONS_DBUS,
- IndicatorSessionActionsDbusPriv);
+ p = indicator_session_actions_dbus_get_instance_private (self);
p->cancellable = g_cancellable_new ();
p->seat_allows_activation = TRUE;
self->priv = p;
diff --git a/src/backend-dbus/actions.h b/src/backend-dbus/actions.h
index 97d816a..dac392c 100644
--- a/src/backend-dbus/actions.h
+++ b/src/backend-dbus/actions.h
@@ -37,7 +37,7 @@ G_BEGIN_DECLS
#define INDICATOR_IS_SESSION_ACTIONS_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_SESSION_ACTIONS_DBUS))
typedef struct _IndicatorSessionActionsDbus IndicatorSessionActionsDbus;
-typedef struct _IndicatorSessionActionsDbusPriv IndicatorSessionActionsDbusPriv;
+typedef struct _IndicatorSessionActionsDbusPrivate IndicatorSessionActionsDbusPrivate;
typedef struct _IndicatorSessionActionsDbusClass IndicatorSessionActionsDbusClass;
/**
@@ -48,7 +48,7 @@ struct _IndicatorSessionActionsDbus
{
/*< private >*/
IndicatorSessionActions parent;
- IndicatorSessionActionsDbusPriv * priv;
+ IndicatorSessionActionsDbusPrivate * priv;
};
struct _IndicatorSessionActionsDbusClass
diff --git a/src/backend-dbus/guest.c b/src/backend-dbus/guest.c
index 3269097..a1358c5 100644
--- a/src/backend-dbus/guest.c
+++ b/src/backend-dbus/guest.c
@@ -21,7 +21,7 @@
#include "guest.h"
-struct _IndicatorSessionGuestDbusPriv
+struct _IndicatorSessionGuestDbusPrivate
{
GCancellable * cancellable;
@@ -34,11 +34,9 @@ struct _IndicatorSessionGuestDbusPriv
gboolean guest_is_allowed;
};
-typedef IndicatorSessionGuestDbusPriv priv_t;
+typedef IndicatorSessionGuestDbusPrivate priv_t;
-G_DEFINE_TYPE (IndicatorSessionGuestDbus,
- indicator_session_guest_dbus,
- INDICATOR_TYPE_SESSION_GUEST)
+G_DEFINE_TYPE_WITH_PRIVATE (IndicatorSessionGuestDbus, indicator_session_guest_dbus, INDICATOR_TYPE_SESSION_GUEST)
/***
****
@@ -352,8 +350,6 @@ indicator_session_guest_dbus_class_init (IndicatorSessionGuestDbusClass * klass)
guest_class->is_logged_in = my_is_logged_in;
guest_class->is_active = my_is_active;
guest_class->switch_to_guest = my_switch_to_guest;
-
- g_type_class_add_private (klass, sizeof (IndicatorSessionGuestDbusPriv));
}
static void
@@ -361,9 +357,7 @@ indicator_session_guest_dbus_init (IndicatorSessionGuestDbus * self)
{
priv_t * p;
- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
- INDICATOR_TYPE_SESSION_GUEST_DBUS,
- IndicatorSessionGuestDbusPriv);
+ p = indicator_session_guest_dbus_get_instance_private (self);
p->cancellable = g_cancellable_new ();
self->priv = p;
}
diff --git a/src/backend-dbus/guest.h b/src/backend-dbus/guest.h
index 73bb3ca..8f27433 100644
--- a/src/backend-dbus/guest.h
+++ b/src/backend-dbus/guest.h
@@ -37,7 +37,7 @@ G_BEGIN_DECLS
#define INDICATOR_IS_SESSION_GUEST_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_SESSION_GUEST_DBUS))
typedef struct _IndicatorSessionGuestDbus IndicatorSessionGuestDbus;
-typedef struct _IndicatorSessionGuestDbusPriv IndicatorSessionGuestDbusPriv;
+typedef struct _IndicatorSessionGuestDbusPrivate IndicatorSessionGuestDbusPrivate;
typedef struct _IndicatorSessionGuestDbusClass IndicatorSessionGuestDbusClass;
/**
@@ -48,7 +48,7 @@ struct _IndicatorSessionGuestDbus
{
/*< private >*/
IndicatorSessionGuest parent;
- IndicatorSessionGuestDbusPriv * priv;
+ IndicatorSessionGuestDbusPrivate * priv;
};
struct _IndicatorSessionGuestDbusClass
diff --git a/src/backend-dbus/users.c b/src/backend-dbus/users.c
index 29cc29c..e6910c6 100644
--- a/src/backend-dbus/users.c
+++ b/src/backend-dbus/users.c
@@ -21,7 +21,7 @@
#include "users.h"
-struct _IndicatorSessionUsersDbusPriv
+struct _IndicatorSessionUsersDbusPrivate
{
Login1Manager * login1_manager;
Login1Seat * login1_seat;
@@ -45,11 +45,9 @@ struct _IndicatorSessionUsersDbusPriv
guint update_list_tag;
};
-typedef IndicatorSessionUsersDbusPriv priv_t;
+typedef IndicatorSessionUsersDbusPrivate priv_t;
-G_DEFINE_TYPE (IndicatorSessionUsersDbus,
- indicator_session_users_dbus,
- INDICATOR_TYPE_SESSION_USERS)
+G_DEFINE_TYPE_WITH_PRIVATE(IndicatorSessionUsersDbus, indicator_session_users_dbus, INDICATOR_TYPE_SESSION_USERS)
/***
****
@@ -655,8 +653,6 @@ indicator_session_users_dbus_class_init (IndicatorSessionUsersDbusClass * klass)
users_class->get_uids = my_get_uids;
users_class->get_user = my_get_user;
users_class->activate_user = my_activate_user;
-
- g_type_class_add_private (klass, sizeof (IndicatorSessionUsersDbusPriv));
}
static void
@@ -664,9 +660,7 @@ indicator_session_users_dbus_init (IndicatorSessionUsersDbus * self)
{
priv_t * p;
- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
- INDICATOR_TYPE_SESSION_USERS_DBUS,
- IndicatorSessionUsersDbusPriv);
+ p = indicator_session_users_dbus_get_instance_private (self);
self->priv = p;
p->cancellable = g_cancellable_new ();
diff --git a/src/backend-dbus/users.h b/src/backend-dbus/users.h
index d6c17df..ed8c686 100644
--- a/src/backend-dbus/users.h
+++ b/src/backend-dbus/users.h
@@ -37,7 +37,7 @@ G_BEGIN_DECLS
#define INDICATOR_IS_SESSION_USERS_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_SESSION_USERS_DBUS))
typedef struct _IndicatorSessionUsersDbus IndicatorSessionUsersDbus;
-typedef struct _IndicatorSessionUsersDbusPriv IndicatorSessionUsersDbusPriv;
+typedef struct _IndicatorSessionUsersDbusPrivate IndicatorSessionUsersDbusPrivate;
typedef struct _IndicatorSessionUsersDbusClass IndicatorSessionUsersDbusClass;
/**
@@ -48,7 +48,7 @@ struct _IndicatorSessionUsersDbus
{
/*< private >*/
IndicatorSessionUsers parent;
- IndicatorSessionUsersDbusPriv * priv;
+ IndicatorSessionUsersDbusPrivate * priv;
};
struct _IndicatorSessionUsersDbusClass
diff --git a/src/recoverable-problem.c b/src/recoverable-problem.c
index 670b78c..f1f8890 100644
--- a/src/recoverable-problem.c
+++ b/src/recoverable-problem.c
@@ -45,7 +45,7 @@ write_null (int fd)
/* Child watcher */
static gboolean
-apport_child_watch (GPid pid G_GNUC_UNUSED, gint status G_GNUC_UNUSED, gpointer user_data)
+apport_child_watch (gpointer user_data)
{
g_main_loop_quit((GMainLoop *)user_data);
return FALSE;
@@ -145,7 +145,7 @@ report_recoverable_problem (const gchar * signature, GPid report_pid, gboolean w
child_source = g_child_watch_source_new(pid);
g_source_attach(child_source, context);
- g_source_set_callback(child_source, (GSourceFunc)apport_child_watch, loop, NULL);
+ g_source_set_callback(child_source, apport_child_watch, loop, NULL);
timeout_source = g_timeout_source_new_seconds(5);
g_source_attach(timeout_source, context);
diff --git a/src/service.c b/src/service.c
index 4f547b3..c364864 100644
--- a/src/service.c
+++ b/src/service.c
@@ -33,10 +33,6 @@
#define ICON_INFO "system-devices-panel-information"
#define ICON_ALERT "system-devices-panel-alert"
-G_DEFINE_TYPE (IndicatorSessionService,
- indicator_session_service,
- G_TYPE_OBJECT)
-
/* signals enum */
enum
{
@@ -117,6 +113,8 @@ struct _IndicatorSessionServicePrivate
typedef IndicatorSessionServicePrivate priv_t;
+G_DEFINE_TYPE_WITH_PRIVATE(IndicatorSessionService, indicator_session_service, G_TYPE_OBJECT)
+
static const char * get_current_real_name (IndicatorSessionService * self);
/***
@@ -1175,9 +1173,7 @@ indicator_session_service_init (IndicatorSessionService * self)
GIcon * icon;
/* init our priv pointer */
- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
- INDICATOR_TYPE_SESSION_SERVICE,
- IndicatorSessionServicePrivate);
+ p = indicator_session_service_get_instance_private (self);
p->indicator_settings = g_settings_new ("org.ayatana.indicator.session");
if (is_mate())
p->keybinding_settings = g_settings_new ("org.mate.SettingsDaemon.plugins.media-keys");
@@ -1376,8 +1372,6 @@ indicator_session_service_class_init (IndicatorSessionServiceClass * klass)
object_class->get_property = my_get_property;
object_class->set_property = my_set_property;
- 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,