diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-04-18 00:25:03 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-04-18 00:25:03 +0200 |
commit | 6923ef5295e8e24677270553aaa71b413530837f (patch) | |
tree | 3c461917e421cd31234c09796dc8a90eccb72c7c /src/krb5-auth-gconf.c | |
parent | it has kind of a homepage now (diff) | |
parent | Imported Upstream version 0.9~rc1 (diff) | |
download | krb5-auth-dialog-6923ef5295e8e24677270553aaa71b413530837f.tar.gz krb5-auth-dialog-6923ef5295e8e24677270553aaa71b413530837f.tar.bz2 krb5-auth-dialog-6923ef5295e8e24677270553aaa71b413530837f.zip |
Merge commit 'upstream/0.9.rc1'
Diffstat (limited to 'src/krb5-auth-gconf.c')
-rw-r--r-- | src/krb5-auth-gconf.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/krb5-auth-gconf.c b/src/krb5-auth-gconf.c index 25eb555..497b1a7 100644 --- a/src/krb5-auth-gconf.c +++ b/src/krb5-auth-gconf.c @@ -20,6 +20,7 @@ #include "config.h" #include <gconf/gconf-client.h> +#include <string.h> #include "krb5-auth-applet.h" #include "krb5-auth-gconf-tools.h" @@ -30,7 +31,9 @@ ka_gconf_set_principal (GConfClient* client, KaApplet* applet) { gchar* principal = NULL; - if(!ka_gconf_get_string (client, KA_GCONF_KEY_PRINCIPAL, &principal)) { + if(!ka_gconf_get_string (client, KA_GCONF_KEY_PRINCIPAL, &principal) + || !strlen(principal)) { + g_free (principal); principal = g_strdup (g_get_user_name()); } g_object_set(applet, "principal", principal, NULL); @@ -54,6 +57,20 @@ ka_gconf_set_pk_userid (GConfClient* client, KaApplet* applet) static gboolean +ka_gconf_set_pk_anchors (GConfClient* client, KaApplet* applet) +{ + gchar* pk_anchors = NULL; + + if(!ka_gconf_get_string (client, KA_GCONF_KEY_PK_ANCHORS, &pk_anchors)) { + pk_anchors = g_strdup (""); + } + g_object_set(applet, "pk_anchors", pk_anchors, NULL); + g_free (pk_anchors); + return TRUE; +} + + +static gboolean ka_gconf_set_prompt_mins (GConfClient* client, KaApplet* applet) { gint prompt_mins = 0; @@ -140,6 +157,8 @@ ka_gconf_key_changed_callback (GConfClient* client, ka_gconf_set_show_trayicon (client, applet); } else if (g_strcmp0 (key, KA_GCONF_KEY_PK_USERID) == 0) { ka_gconf_set_pk_userid (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_PK_ANCHORS) == 0) { + ka_gconf_set_pk_anchors(client, applet); } else if (g_strcmp0 (key, KA_GCONF_KEY_FORWARDABLE) == 0) { ka_gconf_set_tgt_forwardable (client, applet); } else if (g_strcmp0 (key, KA_GCONF_KEY_RENEWABLE) == 0) { @@ -176,6 +195,7 @@ ka_gconf_init (KaApplet* applet, ka_gconf_set_prompt_mins (client, applet); ka_gconf_set_show_trayicon (client, applet); ka_gconf_set_pk_userid(client, applet); + ka_gconf_set_pk_anchors(client, applet); ka_gconf_set_tgt_forwardable(client, applet); ka_gconf_set_tgt_renewable(client, applet); ka_gconf_set_tgt_proxiable(client, applet); |