aboutsummaryrefslogtreecommitdiff
path: root/src/ka-dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ka-dialog.c')
-rw-r--r--src/ka-dialog.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/ka-dialog.c b/src/ka-dialog.c
index ce86367..3114f49 100644
--- a/src/ka-dialog.c
+++ b/src/ka-dialog.c
@@ -502,6 +502,15 @@ credentials_expiring (gpointer *data)
}
+/* run once, then terminate the timer */
+static gboolean
+credentials_expiring_once (gpointer *data)
+{
+ credentials_expiring(data);
+ return FALSE;
+}
+
+
/*
* set ticket options by looking at krb5.conf and gconf
*/
@@ -1056,9 +1065,10 @@ main (int argc, char *argv[])
const char *help_msg = "Run '" PACKAGE " --help' to see a full list of available command line options";
const GOptionEntry options [] = {
{"auto", 'a', 0, G_OPTION_ARG_NONE, &run_auto,
- "Only run if an initialized ccache is found (default)", NULL},
+ "Only run if an initialized ccache is found", NULL},
+ /* accepted for compatibility only */
{"always", 'A', 0, G_OPTION_ARG_NONE, &run_always,
- "Always run", NULL},
+ "Always run (default)", NULL},
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
GFileMonitor *monitor = NULL;
@@ -1085,10 +1095,7 @@ main (int argc, char *argv[])
if (!ka_dbus_connect (&status))
exit(status);
- if (run_always && !run_auto) {
- always_run = TRUE;
- }
-
+ always_run = !run_auto;
if (using_krb5 () || always_run) {
g_set_application_name (KA_NAME);
@@ -1098,6 +1105,7 @@ main (int argc, char *argv[])
ka_nm_init();
g_timeout_add_seconds (CREDENTIAL_CHECK_INTERVAL, (GSourceFunc)credentials_expiring, applet);
+ g_idle_add ((GSourceFunc)credentials_expiring_once, applet);
monitor = monitor_ccache (applet);
ka_dbus_service(applet);
bgstack15