summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2021-02-16 11:11:41 +1300
committerRobert Ancell <robert.ancell@gmail.com>2021-02-16 11:25:37 +1300
commit641eb8cb40fc397421a3284025769c590ebee868 (patch)
tree940e4e02bbf1a8f58f844ec7f419efc85a0b2a24
parent257983cc1ed4cf3719b2eb1dd2665b710665bbab (diff)
downloadlightdm-git-641eb8cb40fc397421a3284025769c590ebee868.tar.gz
Remove deprecated use of G_TYPE_INSTANCE_GET_PRIVATE
-rw-r--r--common/configuration.c2
-rw-r--r--common/user-list.c115
-rw-r--r--liblightdm-gobject/greeter.c70
-rw-r--r--liblightdm-gobject/language.c14
-rw-r--r--liblightdm-gobject/layout.c18
-rw-r--r--liblightdm-gobject/session.c29
-rw-r--r--liblightdm-gobject/user.c87
7 files changed, 205 insertions, 130 deletions
diff --git a/common/configuration.c b/common/configuration.c
index 058e69e2..30580ead 100644
--- a/common/configuration.c
+++ b/common/configuration.c
@@ -321,7 +321,7 @@ config_get_boolean (Configuration *config, const gchar *section, const gchar *ke
static void
config_init (Configuration *config)
{
- config->priv = G_TYPE_INSTANCE_GET_PRIVATE (config, CONFIGURATION_TYPE, ConfigurationPrivate);
+ config->priv = config_get_instance_private (config);
config->priv->key_file = g_key_file_new ();
config->priv->key_sources = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
config->priv->lightdm_keys = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
diff --git a/common/user-list.c b/common/user-list.c
index b3d6d9ef..fc04a127 100644
--- a/common/user-list.c
+++ b/common/user-list.c
@@ -163,9 +163,6 @@ G_DEFINE_TYPE_WITH_PRIVATE (CommonUser, common_user, G_TYPE_OBJECT)
GType common_session_get_type (void);
G_DEFINE_TYPE (CommonSession, common_session, G_TYPE_OBJECT)
-#define GET_LIST_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), COMMON_TYPE_USER_LIST, CommonUserListPrivate)
-#define GET_USER_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), COMMON_TYPE_USER, CommonUserPrivate)
-
#define PASSWD_FILE "/etc/passwd"
#define USER_CONFIG_FILE "/etc/lightdm/users.conf"
@@ -195,7 +192,7 @@ common_user_list_cleanup (void)
static CommonUser *
get_user_by_name (CommonUserList *user_list, const gchar *username)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
for (GList *link = priv->users; link; link = link->next)
{
@@ -210,12 +207,13 @@ get_user_by_name (CommonUserList *user_list, const gchar *username)
static CommonUser *
get_user_by_path (CommonUserList *user_list, const gchar *path)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
for (GList *link = priv->users; link; link = link->next)
{
CommonUser *user = link->data;
- if (g_strcmp0 (GET_USER_PRIVATE (user)->path, path) == 0)
+ CommonUserPrivate *user_priv = common_user_get_instance_private (user);
+ if (g_strcmp0 (user_priv->path, path) == 0)
return user;
}
@@ -232,7 +230,7 @@ compare_user (gconstpointer a, gconstpointer b)
static gboolean
update_passwd_user (CommonUser *user, const gchar *real_name, const gchar *home_directory, const gchar *shell, const gchar *image)
{
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
/* Skip if already set to this */
if (g_strcmp0 (common_user_get_real_name (user), real_name) == 0 &&
@@ -258,13 +256,14 @@ static void load_sessions (CommonUserList *user_list);
static gboolean
get_logged_in_cb (CommonUser *user, CommonUserList *user_list)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
+ CommonUserPrivate *user_priv = common_user_get_instance_private (user);
// Lazily decide to load/listen to sessions
if (priv->session_added_signal == 0)
load_sessions (user_list);
- const gchar *username = GET_USER_PRIVATE (user)->name;
+ const gchar *username = user_priv->name;
for (GList *link = priv->sessions; link; link = link->next)
{
CommonSession *session = link->data;
@@ -285,7 +284,7 @@ static CommonUser *
make_passwd_user (CommonUserList *user_list, struct passwd *entry)
{
CommonUser *user = g_object_new (COMMON_TYPE_USER, NULL);
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
g_signal_connect (user, "get-logged-in", G_CALLBACK (get_logged_in_cb), user_list);
@@ -322,7 +321,7 @@ make_passwd_user (CommonUserList *user_list, struct passwd *entry)
static void
load_passwd_file (CommonUserList *user_list, gboolean emit_add_signal)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
g_debug ("Loading user config from %s", USER_CONFIG_FILE);
@@ -469,7 +468,7 @@ accounts_user_changed_cb (GDBusConnection *connection,
gpointer data)
{
CommonUser *user = data;
- /*CommonUserPrivate *priv = GET_USER_PRIVATE (user);*/
+ /*CommonUserPrivate *priv = common_user_get_instance_private (user);*/
/* Log message disabled as AccountsService can have arbitrary plugins that
* might cause us to log when properties change we don't use. LP: #1376357
@@ -482,7 +481,7 @@ accounts_user_changed_cb (GDBusConnection *connection,
static gboolean
load_accounts_user (CommonUser *user)
{
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
/* Get the properties for this user */
if (!priv->changed_signal)
@@ -615,10 +614,10 @@ load_accounts_user (CommonUser *user)
static void
add_accounts_user (CommonUserList *user_list, const gchar *path, gboolean emit_signal)
{
- CommonUserListPrivate *list_priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *list_priv = common_user_list_get_instance_private (user_list);
CommonUser *user = g_object_new (COMMON_TYPE_USER, NULL);
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
g_debug ("User %s added", path);
priv->bus = g_object_ref (list_priv->bus);
@@ -671,7 +670,7 @@ accounts_user_deleted_cb (GDBusConnection *connection,
gpointer data)
{
CommonUserList *user_list = data;
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(o)")))
{
@@ -698,7 +697,7 @@ accounts_user_deleted_cb (GDBusConnection *connection,
static CommonSession *
load_session (CommonUserList *user_list, const gchar *path)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) result = g_dbus_connection_call_sync (priv->bus,
@@ -772,7 +771,7 @@ session_removed_cb (GDBusConnection *connection,
gpointer data)
{
CommonUserList *user_list = data;
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(o)")))
{
@@ -802,7 +801,7 @@ session_removed_cb (GDBusConnection *connection,
static void
load_sessions (CommonUserList *user_list)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
priv->session_added_signal = g_dbus_connection_signal_subscribe (priv->bus,
"org.freedesktop.DisplayManager",
@@ -861,7 +860,7 @@ load_sessions (CommonUserList *user_list)
static void
load_users (CommonUserList *user_list)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
if (priv->have_users)
return;
@@ -942,8 +941,10 @@ gint
common_user_list_get_length (CommonUserList *user_list)
{
g_return_val_if_fail (COMMON_IS_USER_LIST (user_list), 0);
+
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
load_users (user_list);
- return g_list_length (GET_LIST_PRIVATE (user_list)->users);
+ return g_list_length (priv->users);
}
/**
@@ -959,8 +960,10 @@ GList *
common_user_list_get_users (CommonUserList *user_list)
{
g_return_val_if_fail (COMMON_IS_USER_LIST (user_list), NULL);
+
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
load_users (user_list);
- return GET_LIST_PRIVATE (user_list)->users;
+ return priv->users;
}
/**
@@ -1000,7 +1003,7 @@ common_user_list_get_user_by_name (CommonUserList *user_list, const gchar *usern
static void
common_user_list_init (CommonUserList *user_list)
{
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (user_list);
priv->bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
}
@@ -1037,7 +1040,7 @@ static void
common_user_list_finalize (GObject *object)
{
CommonUserList *self = COMMON_USER_LIST (object);
- CommonUserListPrivate *priv = GET_LIST_PRIVATE (self);
+ CommonUserListPrivate *priv = common_user_list_get_instance_private (self);
/* Remove children first, they might access us */
g_list_free_full (priv->users, g_object_unref);
@@ -1126,7 +1129,7 @@ static gboolean
call_method (CommonUser *user, const gchar *method, GVariant *args,
const gchar *expected, GVariant **result)
{
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) answer = g_dbus_connection_call_sync (priv->bus,
@@ -1165,7 +1168,7 @@ save_string_to_dmrc (CommonUser *user, const gchar *group,
static void
load_dmrc (CommonUser *user)
{
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
/* We're using Accounts service instead */
if (priv->path)
@@ -1206,7 +1209,9 @@ const gchar *
common_user_get_name (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
- return GET_USER_PRIVATE (user)->name;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->name;
}
/**
@@ -1221,7 +1226,9 @@ const gchar *
common_user_get_real_name (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
- return GET_USER_PRIVATE (user)->real_name;
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+
+ return priv->real_name;
}
/**
@@ -1237,7 +1244,7 @@ common_user_get_display_name (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
if (!priv->real_name || strcmp (priv->real_name, "") == 0)
return priv->name;
else
@@ -1256,7 +1263,9 @@ const gchar *
common_user_get_home_directory (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
- return GET_USER_PRIVATE (user)->home_directory;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->home_directory;
}
/**
@@ -1271,7 +1280,9 @@ const gchar *
common_user_get_shell (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
- return GET_USER_PRIVATE (user)->shell;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->shell;
}
/**
@@ -1286,7 +1297,9 @@ const gchar *
common_user_get_image (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
- return GET_USER_PRIVATE (user)->image;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->image;
}
/**
@@ -1301,7 +1314,9 @@ const gchar *
common_user_get_background (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
- return GET_USER_PRIVATE (user)->background;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->background;
}
/**
@@ -1316,8 +1331,10 @@ const gchar *
common_user_get_language (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
load_dmrc (user);
- const gchar *language = GET_USER_PRIVATE (user)->language;
+ const gchar *language = priv->language;
return (language && language[0] == 0) ? NULL : language; /* Treat "" as NULL */
}
@@ -1351,8 +1368,10 @@ const gchar *
common_user_get_layout (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
load_dmrc (user);
- return GET_USER_PRIVATE (user)->layouts[0];
+ return priv->layouts[0];
}
/**
@@ -1367,8 +1386,10 @@ const gchar * const *
common_user_get_layouts (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
load_dmrc (user);
- return (const gchar * const *) GET_USER_PRIVATE (user)->layouts;
+ return (const gchar * const *) priv->layouts;
}
/**
@@ -1383,8 +1404,10 @@ const gchar *
common_user_get_session (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), NULL);
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
load_dmrc (user);
- const gchar *session = GET_USER_PRIVATE (user)->session;
+ const gchar *session = priv->session;
return (session && session[0] == 0) ? NULL : session; /* Treat "" as NULL */
}
@@ -1437,7 +1460,9 @@ gboolean
common_user_get_has_messages (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), FALSE);
- return GET_USER_PRIVATE (user)->has_messages;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->has_messages;
}
/**
@@ -1452,7 +1477,9 @@ uid_t
common_user_get_uid (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), 0);
- return GET_USER_PRIVATE (user)->uid;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->uid;
}
/**
@@ -1470,7 +1497,7 @@ common_user_get_gid (CommonUser *user)
/* gid is not actually stored in AccountsService, so if our user is from
AccountsService, we have to look up manually in passwd. gid won't
change, so just look up the first time we're asked and never again. */
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
if (priv->uid != 0 && priv->gid == 0)
{
struct passwd *entry = getpwuid (priv->uid);
@@ -1492,13 +1519,15 @@ gboolean
common_user_get_is_locked (CommonUser *user)
{
g_return_val_if_fail (COMMON_IS_USER (user), FALSE);
- return GET_USER_PRIVATE (user)->is_locked;
+
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
+ return priv->is_locked;
}
static void
common_user_init (CommonUser *user)
{
- CommonUserPrivate *priv = GET_USER_PRIVATE (user);
+ CommonUserPrivate *priv = common_user_get_instance_private (user);
priv->layouts = g_malloc (sizeof (gchar *) * 1);
priv->layouts[0] = NULL;
}
@@ -1580,7 +1609,7 @@ static void
common_user_finalize (GObject *object)
{
CommonUser *self = COMMON_USER (object);
- CommonUserPrivate *priv = GET_USER_PRIVATE (self);
+ CommonUserPrivate *priv = common_user_get_instance_private (self);
g_clear_pointer (&priv->path, g_free);
if (priv->changed_signal)
diff --git a/liblightdm-gobject/greeter.c b/liblightdm-gobject/greeter.c
index fd1763c0..f8bc6854 100644
--- a/liblightdm-gobject/greeter.c
+++ b/liblightdm-gobject/greeter.c
@@ -168,8 +168,6 @@ typedef struct
G_DEFINE_TYPE_WITH_PRIVATE (LightDMGreeter, lightdm_greeter, G_TYPE_OBJECT)
-#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_GREETER, LightDMGreeterPrivate)
-
#define HEADER_SIZE 8
#define MAX_MESSAGE_LENGTH 1024
#define API_VERSION 1
@@ -306,7 +304,7 @@ lightdm_greeter_set_resettable (LightDMGreeter *greeter, gboolean resettable)
{
g_return_if_fail (LIGHTDM_IS_GREETER (greeter));
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_if_fail (!priv->connected);
priv->resettable = resettable;
@@ -353,7 +351,7 @@ static gboolean
timed_login_cb (gpointer data)
{
LightDMGreeter *greeter = data;
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
priv->autologin_timeout = 0;
g_signal_emit (G_OBJECT (greeter), signals[AUTOLOGIN_TIMER_EXPIRED], 0);
@@ -466,7 +464,7 @@ get_message_length (guint8 *message, gsize message_length)
static gboolean
connect_to_daemon (LightDMGreeter *greeter, GError **error)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
if (priv->to_server_channel || priv->from_server_channel)
return TRUE;
@@ -512,7 +510,7 @@ connect_to_daemon (LightDMGreeter *greeter, GError **error)
static gboolean
send_message (LightDMGreeter *greeter, guint8 *message, gsize message_length, GError **error)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
if (!connect_to_daemon (greeter, error))
return FALSE;
@@ -566,7 +564,7 @@ send_message (LightDMGreeter *greeter, guint8 *message, gsize message_length, GE
static void
handle_connected (LightDMGreeter *greeter, gboolean v2, guint8 *message, gsize message_length, gsize *offset)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
int timeout;
Request *request;
@@ -625,7 +623,7 @@ handle_connected (LightDMGreeter *greeter, gboolean v2, guint8 *message, gsize m
static void
handle_prompt_authentication (LightDMGreeter *greeter, guint8 *message, gsize message_length, gsize *offset)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
guint32 sequence_number = read_int (message, message_length, offset);
if (sequence_number != priv->authenticate_sequence_number)
@@ -686,7 +684,7 @@ handle_prompt_authentication (LightDMGreeter *greeter, guint8 *message, gsize me
static void
handle_end_authentication (LightDMGreeter *greeter, guint8 *message, gsize message_length, gsize *offset)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
guint32 sequence_number = read_int (message, message_length, offset);
if (sequence_number != priv->authenticate_sequence_number)
@@ -725,7 +723,7 @@ handle_idle (LightDMGreeter *greeter, guint8 *message, gsize message_length, gsi
static void
handle_reset (LightDMGreeter *greeter, guint8 *message, gsize message_length, gsize *offset)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_hash_table_remove_all (priv->hints);
@@ -746,7 +744,7 @@ handle_reset (LightDMGreeter *greeter, guint8 *message, gsize message_length, gs
static void
handle_session_result (LightDMGreeter *greeter, guint8 *message, gsize message_length, gsize *offset)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
/* Notify asynchronous caller */
Request *request = g_list_nth_data (priv->start_session_requests, 0);
@@ -767,7 +765,7 @@ handle_session_result (LightDMGreeter *greeter, guint8 *message, gsize message_l
static void
handle_shared_dir_result (LightDMGreeter *greeter, guint8 *message, gsize message_length, gsize *offset)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
/* Notify asynchronous caller */
Request *request = g_list_nth_data (priv->ensure_shared_data_dir_requests, 0);
@@ -829,7 +827,7 @@ handle_message (LightDMGreeter *greeter, guint8 *message, gsize message_length)
static gboolean
recv_message (LightDMGreeter *greeter, gboolean block, guint8 **message, gsize *length, GError **error)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
if (!connect_to_daemon (greeter, error))
return FALSE;
@@ -980,7 +978,7 @@ lightdm_greeter_connect_to_daemon (LightDMGreeter *greeter, GCancellable *cancel
{
g_return_if_fail (LIGHTDM_IS_GREETER (greeter));
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
Request *request = request_new (greeter, cancellable, callback, user_data);
GError *error = NULL;
@@ -1029,7 +1027,7 @@ lightdm_greeter_connect_to_daemon_sync (LightDMGreeter *greeter, GError **error)
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
/* Read until we are connected */
if (!send_connect (greeter, priv->resettable, error))
@@ -1078,7 +1076,9 @@ const gchar *
lightdm_greeter_get_hint (LightDMGreeter *greeter, const gchar *name)
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), NULL);
- return g_hash_table_lookup (GET_PRIVATE (greeter)->hints, name);
+
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
+ return g_hash_table_lookup (priv->hints, name);
}
/**
@@ -1301,7 +1301,7 @@ lightdm_greeter_cancel_autologin (LightDMGreeter *greeter)
{
g_return_if_fail (LIGHTDM_IS_GREETER (greeter));
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
if (priv->autologin_timeout)
g_source_remove (priv->autologin_timeout);
@@ -1323,7 +1323,7 @@ lightdm_greeter_authenticate (LightDMGreeter *greeter, const gchar *username, GE
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, FALSE);
@@ -1360,7 +1360,7 @@ lightdm_greeter_authenticate_as_guest (LightDMGreeter *greeter, GError **error)
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, FALSE);
@@ -1420,7 +1420,7 @@ lightdm_greeter_authenticate_remote (LightDMGreeter *greeter, const gchar *sessi
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, FALSE);
@@ -1461,7 +1461,7 @@ lightdm_greeter_respond (LightDMGreeter *greeter, const gchar *response, GError
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
g_return_val_if_fail (response != NULL, FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, FALSE);
g_return_val_if_fail (priv->n_responses_waiting > 0, FALSE);
@@ -1511,7 +1511,7 @@ lightdm_greeter_cancel_authentication (LightDMGreeter *greeter, GError **error)
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, FALSE);
@@ -1534,7 +1534,9 @@ gboolean
lightdm_greeter_get_in_authentication (LightDMGreeter *greeter)
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- return GET_PRIVATE (greeter)->in_authentication;
+
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
+ return priv->in_authentication;
}
/**
@@ -1549,7 +1551,9 @@ gboolean
lightdm_greeter_get_is_authenticated (LightDMGreeter *greeter)
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- return GET_PRIVATE (greeter)->is_authenticated;
+
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
+ return priv->is_authenticated;
}
/**
@@ -1564,7 +1568,9 @@ const gchar *
lightdm_greeter_get_authentication_user (LightDMGreeter *greeter)
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), NULL);
- return GET_PRIVATE (greeter)->authentication_user;
+
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
+ return priv->authentication_user;
}
/**
@@ -1582,7 +1588,7 @@ lightdm_greeter_set_language (LightDMGreeter *greeter, const gchar *language, GE
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, FALSE);
@@ -1612,7 +1618,7 @@ lightdm_greeter_start_session (LightDMGreeter *greeter, const gchar *session, GC
{
g_return_if_fail (LIGHTDM_IS_GREETER (greeter));
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
Request *request = request_new (greeter, cancellable, callback, user_data);
priv->start_session_requests = g_list_append (priv->start_session_requests, request);
@@ -1660,7 +1666,7 @@ lightdm_greeter_start_session_sync (LightDMGreeter *greeter, const gchar *sessio
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, FALSE);
g_return_val_if_fail (priv->is_authenticated, FALSE);
@@ -1706,7 +1712,7 @@ lightdm_greeter_ensure_shared_data_dir (LightDMGreeter *greeter, const gchar *us
{
g_return_if_fail (LIGHTDM_IS_GREETER (greeter));
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
Request *request = request_new (greeter, cancellable, callback, user_data);
priv->ensure_shared_data_dir_requests = g_list_append (priv->ensure_shared_data_dir_requests, request);
@@ -1763,7 +1769,7 @@ lightdm_greeter_ensure_shared_data_dir_sync (LightDMGreeter *greeter, const gcha
{
g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), NULL);
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
g_return_val_if_fail (priv->connected, NULL);
@@ -1787,7 +1793,7 @@ lightdm_greeter_ensure_shared_data_dir_sync (LightDMGreeter *greeter, const gcha
static void
lightdm_greeter_init (LightDMGreeter *greeter)
{
- LightDMGreeterPrivate *priv = GET_PRIVATE (greeter);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (greeter);
priv->read_buffer = g_malloc (HEADER_SIZE);
priv->hints = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
@@ -1866,7 +1872,7 @@ static void
lightdm_greeter_finalize (GObject *object)
{
LightDMGreeter *self = LIGHTDM_GREETER (object);
- LightDMGreeterPrivate *priv = GET_PRIVATE (self);
+ LightDMGreeterPrivate *priv = lightdm_greeter_get_instance_private (self);
g_clear_object (&priv->socket);
if (priv->to_server_channel)
diff --git a/liblightdm-gobject/language.c b/liblightdm-gobject/language.c
index 3d4fa961..e3f97511 100644
--- a/liblightdm-gobject/language.c
+++ b/liblightdm-gobject/language.c
@@ -52,8 +52,6 @@ typedef struct
G_DEFINE_TYPE_WITH_PRIVATE (LightDMLanguage, lightdm_language, G_TYPE_OBJECT)
-#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_LANGUAGE, LightDMLanguagePrivate)
-
static gboolean have_languages = FALSE;
static GList *languages = NULL;
@@ -190,7 +188,9 @@ const gchar *
lightdm_language_get_code (LightDMLanguage *language)
{
g_return_val_if_fail (LIGHTDM_IS_LANGUAGE (language), NULL);
- return GET_PRIVATE (language)->code;
+
+ LightDMLanguagePrivate *priv = lightdm_language_get_instance_private (language);
+ return priv->code;
}
/**
@@ -206,7 +206,7 @@ lightdm_language_get_name (LightDMLanguage *language)
{
g_return_val_if_fail (LIGHTDM_IS_LANGUAGE (language), NULL);
- LightDMLanguagePrivate *priv = GET_PRIVATE (language);
+ LightDMLanguagePrivate *priv = lightdm_language_get_instance_private (language);
if (!priv->name)
{
@@ -246,7 +246,7 @@ lightdm_language_get_territory (LightDMLanguage *language)
{
g_return_val_if_fail (LIGHTDM_IS_LANGUAGE (language), NULL);
- LightDMLanguagePrivate *priv = GET_PRIVATE (language);
+ LightDMLanguagePrivate *priv = lightdm_language_get_instance_private (language);
if (!priv->territory && strchr (priv->code, '_'))
{
@@ -288,7 +288,7 @@ lightdm_language_matches (LightDMLanguage *language, const gchar *code)
g_return_val_if_fail (LIGHTDM_IS_LANGUAGE (language), FALSE);
g_return_val_if_fail (code != NULL, FALSE);
- LightDMLanguagePrivate *priv = GET_PRIVATE (language);
+ LightDMLanguagePrivate *priv = lightdm_language_get_instance_private (language);
/* Handle the fact the UTF-8 is specified both as '.utf8' and '.UTF-8' */
if (is_utf8 (priv->code) && is_utf8 (code))
@@ -314,7 +314,7 @@ lightdm_language_set_property (GObject *object,
GParamSpec *pspec)
{
LightDMLanguage *self = LIGHTDM_LANGUAGE (object);
- LightDMLanguagePrivate *priv = GET_PRIVATE (self);
+ LightDMLanguagePrivate *priv = lightdm_language_get_instance_private (self);
switch (prop_id) {
case PROP_CODE:
diff --git a/liblightdm-gobject/layout.c b/liblightdm-gobject/layout.c
index 27b9f1c1..ff8d8749 100644
--- a/liblightdm-gobject/layout.c
+++ b/liblightdm-gobject/layout.c
@@ -49,8 +49,6 @@ typedef struct
G_DEFINE_TYPE_WITH_PRIVATE (LightDMLayout, lightdm_layout, G_TYPE_OBJECT)
-#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_LAYOUT, LightDMLayoutPrivate)
-
static gboolean have_layouts = FALSE;
static Display *display = NULL;
static XklEngine *xkl_engine = NULL;
@@ -213,7 +211,9 @@ const gchar *
lightdm_layout_get_name (LightDMLayout *layout)
{
g_return_val_if_fail (LIGHTDM_IS_LAYOUT (layout), NULL);
- return GET_PRIVATE (layout)->name;
+
+ LightDMLayoutPrivate *priv = lightdm_layout_get_instance_private (layout);
+ return priv->name;
}
/**
@@ -228,7 +228,9 @@ const gchar *
lightdm_layout_get_short_description (LightDMLayout *layout)
{
g_return_val_if_fail (LIGHTDM_IS_LAYOUT (layout), NULL);
- return GET_PRIVATE (layout)->short_description;
+
+ LightDMLayoutPrivate *priv = lightdm_layout_get_instance_private (layout);
+ return priv->short_description;
}
/**
@@ -243,7 +245,9 @@ const gchar *
lightdm_layout_get_description (LightDMLayout *layout)
{
g_return_val_if_fail (LIGHTDM_IS_LAYOUT (layout), NULL);
- return GET_PRIVATE (layout)->description;
+
+ LightDMLayoutPrivate *priv = lightdm_layout_get_instance_private (layout);
+ return priv->description;
}
static void
@@ -258,7 +262,7 @@ lightdm_layout_set_property (GObject *object,
GParamSpec *pspec)
{
LightDMLayout *self = LIGHTDM_LAYOUT (object);
- LightDMLayoutPrivate *priv = GET_PRIVATE (self);
+ LightDMLayoutPrivate *priv = lightdm_layout_get_instance_private (self);
switch (prop_id) {
case PROP_NAME:
@@ -307,7 +311,7 @@ static void
lightdm_layout_finalize (GObject *object)
{
LightDMLayout *self = LIGHTDM_LAYOUT (object);
- LightDMLayoutPrivate *priv = GET_PRIVATE (self);
+ LightDMLayoutPrivate *priv = lightdm_layout_get_instance_private (self);
g_free (priv->name);
g_free (priv->short_description);
diff --git a/liblightdm-gobject/session.c b/liblightdm-gobject/session.c
index 73eb88e7..79dcf466 100644
--- a/liblightdm-gobject/session.c
+++ b/liblightdm-gobject/session.c
@@ -51,8 +51,6 @@ typedef struct
G_DEFINE_TYPE_WITH_PRIVATE (LightDMSession, lightdm_session, G_TYPE_OBJECT)
-#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_SESSION, LightDMSessionPrivate)
-
static gboolean have_sessions = FALSE;
static GList *local_sessions = NULL;
static GList *remote_sessions = NULL;
@@ -60,9 +58,7 @@ static GList *remote_sessions = NULL;
static gint
compare_session (gconstpointer a, gconstpointer b)
{
- LightDMSessionPrivate *priv_a = GET_PRIVATE (a);
- LightDMSessionPrivate *priv_b = GET_PRIVATE (b);
- return strcmp (priv_a->name, priv_b->name);
+ return strcmp (lightdm_session_get_name (LIGHTDM_SESSION (a)), lightdm_session_get_name (LIGHTDM_SESSION (b)));
}
static LightDMSession *
@@ -97,7 +93,7 @@ load_session (GKeyFile *key_file, const gchar *key, const gchar *default_type)
type = strdup (default_type);
LightDMSession *session = g_object_new (LIGHTDM_TYPE_SESSION, NULL);
- LightDMSessionPrivate *priv = GET_PRIVATE (session);
+ LightDMSessionPrivate *priv = lightdm_session_get_instance_private (session);
g_free (priv->key);
priv->key = g_strdup (key);
@@ -147,9 +143,10 @@ load_sessions_dir (GList *sessions, const gchar *sessions_dir, const gchar *defa
{
g_autofree gchar *key = g_strndup (filename, strlen (filename) - strlen (".desktop"));
LightDMSession *session = load_session (key_file, key, default_type);
+ LightDMSessionPrivate *priv = lightdm_session_get_instance_private (session);
if (session)
{
- g_debug ("Loaded session %s (%s, %s)", path, GET_PRIVATE (session)->name, GET_PRIVATE (session)->comment);
+ g_debug ("Loaded session %s (%s, %s)", path, priv->name, priv->comment);
sessions = g_list_insert_sorted (sessions, session, compare_session);
}
else
@@ -252,7 +249,9 @@ const gchar *
lightdm_session_get_key (LightDMSession *session)
{
g_return_val_if_fail (LIGHTDM_IS_SESSION (session), NULL);
- return GET_PRIVATE (session)->key;
+
+ LightDMSessionPrivate *priv = lightdm_session_get_instance_private (session);
+ return priv->key;
}
/**
@@ -267,7 +266,9 @@ const gchar *
lightdm_session_get_session_type (LightDMSession *session)
{
g_return_val_if_fail (LIGHTDM_IS_SESSION (session), NULL);
- return GET_PRIVATE (session)->type;
+
+ LightDMSessionPrivate *priv = lightdm_session_get_instance_private (session);
+ return priv->type;
}
/**
@@ -282,7 +283,9 @@ const gchar *
lightdm_session_get_name (LightDMSession *session)
{
g_return_val_if_fail (LIGHTDM_IS_SESSION (session), NULL);
- return GET_PRIVATE (session)->name;
+
+ LightDMSessionPrivate *priv = lightdm_session_get_instance_private (session);
+ return priv->name;
}
/**
@@ -297,7 +300,9 @@ const gchar *
lightdm_session_get_comment (LightDMSession *session)
{
g_return_val_if_fail (LIGHTDM_IS_SESSION (session), NULL);
- return GET_PRIVATE (session)->comment;
+
+ LightDMSessionPrivate *priv = lightdm_session_get_instance_private (session);
+ return priv->comment;
}
static void
@@ -342,7 +347,7 @@ static void
lightdm_session_finalize (GObject *object)
{
LightDMSession *self = LIGHTDM_SESSION (object);
- LightDMSessionPrivate *priv = GET_PRIVATE (self);
+ LightDMSessionPrivate *priv = lightdm_session_get_instance_private (self);
g_free (priv->key);
g_free (priv->type);
diff --git a/liblightdm-gobject/user.c b/liblightdm-gobject/user.c
index f1eedab4..80d2b8ba 100644
--- a/liblightdm-gobject/user.c
+++ b/liblightdm-gobject/user.c
@@ -116,9 +116,6 @@ typedef struct
G_DEFINE_TYPE_WITH_PRIVATE (LightDMUserList, lightdm_user_list, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (LightDMUser, lightdm_user, G_TYPE_OBJECT)
-#define GET_LIST_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_USER_LIST, LightDMUserListPrivate)
-#define GET_USER_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_USER, LightDMUserPrivate)
-
static LightDMUserList *singleton = NULL;
/**
@@ -153,7 +150,7 @@ wrap_common_user (CommonUser *user)
static void
user_list_added_cb (CommonUserList *common_list, CommonUser *common_user, LightDMUserList *user_list)
{
- LightDMUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (user_list);
GList *common_users = common_user_list_get_users (common_list);
LightDMUser *lightdm_user = wrap_common_user (common_user);
priv->lightdm_list = g_list_insert (priv->lightdm_list, lightdm_user, g_list_index (common_users, common_user));
@@ -163,7 +160,7 @@ user_list_added_cb (CommonUserList *common_list, CommonUser *common_user, LightD
static void
user_list_changed_cb (CommonUserList *common_list, CommonUser *common_user, LightDMUserList *user_list)
{
- LightDMUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (user_list);
GList *common_users = common_user_list_get_users (common_list);
LightDMUser *lightdm_user = g_list_nth_data (priv->lightdm_list, g_list_index (common_users, common_user));
g_signal_emit (user_list, list_signals[USER_CHANGED], 0, lightdm_user);
@@ -172,12 +169,12 @@ user_list_changed_cb (CommonUserList *common_list, CommonUser *common_user, Ligh
static void
user_list_removed_cb (CommonUserList *common_list, CommonUser *common_user, LightDMUserList *user_list)
{
- LightDMUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (user_list);
for (GList *link = priv->lightdm_list; link; link = link->next)
{
LightDMUser *lightdm_user = link->data;
- LightDMUserPrivate *user_priv = GET_USER_PRIVATE (lightdm_user);
+ LightDMUserPrivate *user_priv = lightdm_user_get_instance_private (lightdm_user);
if (user_priv->common_user == common_user)
{
priv->lightdm_list = g_list_delete_link (priv->lightdm_list, link);
@@ -191,7 +188,7 @@ user_list_removed_cb (CommonUserList *common_list, CommonUser *common_user, Ligh
static void
initialize_user_list_if_needed (LightDMUserList *user_list)
{
- LightDMUserListPrivate *priv = GET_LIST_PRIVATE (user_list);
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (user_list);
if (priv->initialized)
return;
@@ -223,8 +220,10 @@ gint
lightdm_user_list_get_length (LightDMUserList *user_list)
{
g_return_val_if_fail (LIGHTDM_IS_USER_LIST (user_list), 0);
+
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (user_list);
initialize_user_list_if_needed (user_list);
- return g_list_length (GET_LIST_PRIVATE (user_list)->lightdm_list);
+ return g_list_length (priv->lightdm_list);
}
/**
@@ -240,8 +239,10 @@ GList *
lightdm_user_list_get_users (LightDMUserList *user_list)
{
g_return_val_if_fail (LIGHTDM_IS_USER_LIST (user_list), NULL);
+
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (user_list);
initialize_user_list_if_needed (user_list);
- return GET_LIST_PRIVATE (user_list)->lightdm_list;
+ return priv->lightdm_list;
}
/**
@@ -259,9 +260,11 @@ lightdm_user_list_get_user_by_name (LightDMUserList *user_list, const gchar *use
g_return_val_if_fail (LIGHTDM_IS_USER_LIST (user_list), NULL);
g_return_val_if_fail (username != NULL, NULL);
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (user_list);
+
initialize_user_list_if_needed (user_list);
- for (GList *link = GET_LIST_PRIVATE (user_list)->lightdm_list; link; link = link->next)
+ for (GList *link = priv->lightdm_list; link; link = link->next)
{
LightDMUser *user = link->data;
if (g_strcmp0 (lightdm_user_get_name (user), username) == 0)
@@ -309,7 +312,7 @@ static void
lightdm_user_list_finalize (GObject *object)
{
LightDMUserList *self = LIGHTDM_USER_LIST (object);
- LightDMUserListPrivate *priv = GET_LIST_PRIVATE (self);
+ LightDMUserListPrivate *priv = lightdm_user_list_get_instance_private (self);
g_list_free_full (priv->lightdm_list, g_object_unref);
@@ -409,7 +412,9 @@ const gchar *
lightdm_user_get_name (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_name (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_name (priv->common_user);
}
/**
@@ -424,7 +429,9 @@ const gchar *
lightdm_user_get_real_name (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_real_name (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_real_name (priv->common_user);
}
/**
@@ -439,7 +446,9 @@ const gchar *
lightdm_user_get_display_name (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_display_name (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_display_name (priv->common_user);
}
/**
@@ -454,7 +463,9 @@ const gchar *
lightdm_user_get_home_directory (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_home_directory (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_home_directory (priv->common_user);
}
/**
@@ -469,7 +480,9 @@ const gchar *
lightdm_user_get_image (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_image (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_image (priv->common_user);
}
/**
@@ -484,7 +497,9 @@ const gchar *
lightdm_user_get_background (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_background (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_background (priv->common_user);
}
/**
@@ -499,7 +514,9 @@ const gchar *
lightdm_user_get_language (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_language (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_language (priv->common_user);
}
/**
@@ -514,7 +531,9 @@ const gchar *
lightdm_user_get_layout (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_layout (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_layout (priv->common_user);
}
/**
@@ -529,7 +548,9 @@ const gchar * const *
lightdm_user_get_layouts (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_layouts (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_layouts (priv->common_user);
}
/**
@@ -544,7 +565,9 @@ const gchar *
lightdm_user_get_session (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), NULL);
- return common_user_get_session (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_session (priv->common_user);
}
/**
@@ -559,7 +582,9 @@ gboolean
lightdm_user_get_logged_in (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), FALSE);
- return common_user_get_logged_in (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_logged_in (priv->common_user);
}
/**
@@ -574,7 +599,9 @@ gboolean
lightdm_user_get_has_messages (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), FALSE);
- return common_user_get_has_messages (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_has_messages (priv->common_user);
}
/**
@@ -589,7 +616,9 @@ uid_t
lightdm_user_get_uid (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), (uid_t)-1);
- return common_user_get_uid (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_uid (priv->common_user);
}
/**
@@ -604,7 +633,9 @@ gboolean
lightdm_user_get_is_locked (LightDMUser *user)
{
g_return_val_if_fail (LIGHTDM_IS_USER (user), FALSE);
- return common_user_get_is_locked (GET_USER_PRIVATE (user)->common_user);
+
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (user);
+ return common_user_get_is_locked (priv->common_user);
}
static void
@@ -619,7 +650,7 @@ lightdm_user_set_property (GObject *object,
GParamSpec *pspec)
{
LightDMUser *self = LIGHTDM_USER (object);
- LightDMUserPrivate *priv = GET_USER_PRIVATE (self);
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (self);
switch (prop_id)
{
@@ -693,7 +724,7 @@ static void
lightdm_user_finalize (GObject *object)
{
LightDMUser *self = LIGHTDM_USER (object);
- LightDMUserPrivate *priv = GET_USER_PRIVATE (self);
+ LightDMUserPrivate *priv = lightdm_user_get_instance_private (self);
g_object_unref (priv->common_user);