diff options
-rw-r--r-- | daemon/gdm-session-worker-job.c | 68 |
1 files changed, 25 insertions, 43 deletions
diff --git a/daemon/gdm-session-worker-job.c b/daemon/gdm-session-worker-job.c index b0967bf5..27878c02 100644 --- a/daemon/gdm-session-worker-job.c +++ b/daemon/gdm-session-worker-job.c @@ -82,10 +82,6 @@ enum { static guint signals [LAST_SIGNAL] = { 0, }; -static void gdm_session_worker_job_class_init (GdmSessionWorkerJobClass *klass); -static void gdm_session_worker_job_init (GdmSessionWorkerJob *session_worker_job); -static void gdm_session_worker_job_finalize (GObject *object); - G_DEFINE_TYPE (GdmSessionWorkerJob, gdm_session_worker_job, G_TYPE_OBJECT) static void @@ -184,6 +180,7 @@ copy_environment_to_hash (GdmSessionWorkerJob *job, } else { environment = g_get_environ (); } + for (i = 0; environment[i]; i++) { char **parts; @@ -211,7 +208,7 @@ get_job_arguments (GdmSessionWorkerJob *job, args = NULL; argv = NULL; error = NULL; - if (! g_shell_parse_argv (job->command, NULL, &argv, &error)) { + if (!g_shell_parse_argv (job->command, NULL, &argv, &error)) { g_warning ("Could not parse command: %s", error->message); g_error_free (error); goto out; @@ -320,7 +317,7 @@ gboolean gdm_session_worker_job_start (GdmSessionWorkerJob *session_worker_job, const char *name) { - gboolean res; + gboolean res; g_return_val_if_fail (GDM_IS_SESSION_WORKER_JOB (session_worker_job), FALSE); @@ -423,6 +420,24 @@ gdm_session_worker_job_set_environment (GdmSessionWorkerJob *session_worker_job, } static void +gdm_session_worker_job_finalize (GObject *object) +{ + GdmSessionWorkerJob *session_worker_job; + + g_return_if_fail (object != NULL); + g_return_if_fail (GDM_IS_SESSION_WORKER_JOB (object)); + + session_worker_job = GDM_SESSION_WORKER_JOB (object); + + gdm_session_worker_job_stop (session_worker_job); + + g_free (session_worker_job->command); + g_free (session_worker_job->server_address); + + G_OBJECT_CLASS (gdm_session_worker_job_parent_class)->finalize (object); +} + +static void gdm_session_worker_job_set_property (GObject *object, guint prop_id, const GValue *value, @@ -474,18 +489,12 @@ gdm_session_worker_job_get_property (GObject *object, } } -static GObject * -gdm_session_worker_job_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties) +static void +gdm_session_worker_job_init (GdmSessionWorkerJob *session_worker_job) { - GdmSessionWorkerJob *session_worker_job; - - session_worker_job = GDM_SESSION_WORKER_JOB (G_OBJECT_CLASS (gdm_session_worker_job_parent_class)->constructor (type, - n_construct_properties, - construct_properties)); + session_worker_job->pid = -1; - return G_OBJECT (session_worker_job); + session_worker_job->command = g_strdup (LIBEXECDIR "/gdm-session-worker"); } static void @@ -495,7 +504,6 @@ gdm_session_worker_job_class_init (GdmSessionWorkerJobClass *klass) object_class->get_property = gdm_session_worker_job_get_property; object_class->set_property = gdm_session_worker_job_set_property; - object_class->constructor = gdm_session_worker_job_constructor; object_class->finalize = gdm_session_worker_job_finalize; g_object_class_install_property (object_class, @@ -553,32 +561,6 @@ gdm_session_worker_job_class_init (GdmSessionWorkerJobClass *klass) G_TYPE_INT); } -static void -gdm_session_worker_job_init (GdmSessionWorkerJob *session_worker_job) -{ - session_worker_job->pid = -1; - - session_worker_job->command = g_strdup (LIBEXECDIR "/gdm-session-worker"); -} - -static void -gdm_session_worker_job_finalize (GObject *object) -{ - GdmSessionWorkerJob *session_worker_job; - - g_return_if_fail (object != NULL); - g_return_if_fail (GDM_IS_SESSION_WORKER_JOB (object)); - - session_worker_job = GDM_SESSION_WORKER_JOB (object); - - gdm_session_worker_job_stop (session_worker_job); - - g_free (session_worker_job->command); - g_free (session_worker_job->server_address); - - G_OBJECT_CLASS (gdm_session_worker_job_parent_class)->finalize (object); -} - GdmSessionWorkerJob * gdm_session_worker_job_new (void) { |