diff options
author | Vincent Untz <vuntz@novell.com> | 2009-02-28 02:47:55 +0100 |
---|---|---|
committer | Vincent Untz <vuntz@novell.com> | 2009-02-28 02:47:55 +0100 |
commit | 8f87fc9073123ccc9637c06b915fb6007d41e88e (patch) | |
tree | 0b3bc8cf56188ca544bceccca7caba80a5483d49 | |
parent | 2a6fb5b50a5cfd790a24c69ab5fe7e26dab3a4ba (diff) |
Code style fixes.
-rw-r--r-- | src/cups-pk-helper-mechanism.c | 45 | ||||
-rw-r--r-- | src/cups.c | 3 |
2 files changed, 32 insertions, 16 deletions
diff --git a/src/cups-pk-helper-mechanism.c b/src/cups-pk-helper-mechanism.c index 6a6a628..0857524 100644 --- a/src/cups-pk-helper-mechanism.c +++ b/src/cups-pk-helper-mechanism.c @@ -58,7 +58,7 @@ static gboolean do_exit (gpointer user_data) { - if (user_data != NULL) + if (user_data != NULL) g_object_unref (CPH_MECHANISM (user_data)); exit (0); @@ -480,7 +480,9 @@ _cph_mechanism_get_callers_user_name (CphMechanism *mechanism, sender = dbus_g_method_get_sender (context); dbus_error_init (&dbus_error); - sender_uid = dbus_bus_get_unix_user (dbus_g_connection_get_connection (mechanism->priv->system_bus_connection), sender, &dbus_error); + sender_uid = dbus_bus_get_unix_user ( + dbus_g_connection_get_connection (mechanism->priv->system_bus_connection), + sender, &dbus_error); password_entry = getpwuid ((uid_t) sender_uid); if (password_entry != NULL) @@ -1045,21 +1047,26 @@ cph_mechanism_job_cancel (CphMechanism *mechanism, { CphJobStatus job_status; gboolean ret; - char *user_name = NULL; + char *user_name; reset_killtimer (mechanism); user_name = _cph_mechanism_get_callers_user_name (mechanism, context); - job_status = cph_cups_job_get_status (mechanism->priv->cups, id, user_name); + job_status = cph_cups_job_get_status (mechanism->priv->cups, + id, user_name); switch (job_status) { case CPH_JOB_STATUS_OWNED_BY_USER: { - if (!_check_polkit_for_action_v (mechanism, context, "job-not-owned-edit", "job-edit", NULL)) + if (!_check_polkit_for_action_v (mechanism, context, + "job-not-owned-edit", + "job-edit", + NULL)) return FALSE; break; } case CPH_JOB_STATUS_NOT_OWNED_BY_USER: { - if (!_check_polkit_for_action (mechanism, context, "job-not-owned-edit")) + if (!_check_polkit_for_action (mechanism, context, + "job-not-owned-edit")) return FALSE; break; } @@ -1082,21 +1089,26 @@ cph_mechanism_job_restart (CphMechanism *mechanism, { CphJobStatus job_status; gboolean ret; - char *user_name = NULL; + char *user_name; reset_killtimer (mechanism); user_name = _cph_mechanism_get_callers_user_name (mechanism, context); - job_status = cph_cups_job_get_status (mechanism->priv->cups, id, user_name); + job_status = cph_cups_job_get_status (mechanism->priv->cups, + id, user_name); switch (job_status) { case CPH_JOB_STATUS_OWNED_BY_USER: { - if (!_check_polkit_for_action_v (mechanism, context, "job-not-owned-edit", "job-edit", NULL)) + if (!_check_polkit_for_action_v (mechanism, context, + "job-not-owned-edit", + "job-edit", + NULL)) return FALSE; break; } case CPH_JOB_STATUS_NOT_OWNED_BY_USER: { - if (!_check_polkit_for_action (mechanism, context, "job-not-owned-edit")) + if (!_check_polkit_for_action (mechanism, context, + "job-not-owned-edit")) return FALSE; break; } @@ -1120,21 +1132,26 @@ cph_mechanism_job_set_hold_until (CphMechanism *mechanism, { CphJobStatus job_status; gboolean ret; - char *user_name = NULL; + char *user_name; reset_killtimer (mechanism); user_name = _cph_mechanism_get_callers_user_name (mechanism, context); - job_status = cph_cups_job_get_status (mechanism->priv->cups, id, user_name); + job_status = cph_cups_job_get_status (mechanism->priv->cups, + id, user_name); switch (job_status) { case CPH_JOB_STATUS_OWNED_BY_USER: { - if (!_check_polkit_for_action_v (mechanism, context, "job-not-owned-edit", "job-edit", NULL)) + if (!_check_polkit_for_action_v (mechanism, context, + "job-not-owned-edit", + "job-edit", + NULL)) return FALSE; break; } case CPH_JOB_STATUS_NOT_OWNED_BY_USER: { - if (!_check_polkit_for_action (mechanism, context, "job-not-owned-edit")) + if (!_check_polkit_for_action (mechanism, context, + "job-not-owned-edit")) return FALSE; break; } @@ -474,8 +474,7 @@ _cph_cups_handle_reply (CphCups *cups, static const char * _cph_cups_get_resource (CphResource resource) { - switch (resource) - { + switch (resource) { case CPH_RESOURCE_ROOT: return "/"; case CPH_RESOURCE_ADMIN: |