[krb5-auth-dialog] Move main() into ka-applet
- From: Guido GÃnther <guidog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [krb5-auth-dialog] Move main() into ka-applet
- Date: Mon, 12 Sep 2011 10:17:56 +0000 (UTC)
commit 9b3059c3b60f586d344d06cc3227ee9b7bee1bb6
Author: Guido GÃnther <agx sigxcpu org>
Date: Mon Sep 12 10:43:57 2011 +0200
Move main() into ka-applet
src/ka-applet.c | 26 +++++++++++++++++++++++---
src/ka-dialog.c | 23 +----------------------
2 files changed, 24 insertions(+), 25 deletions(-)
---
diff --git a/src/ka-applet.c b/src/ka-applet.c
index 879699b..f75eb56 100644
--- a/src/ka-applet.c
+++ b/src/ka-applet.c
@@ -1024,14 +1024,13 @@ ka_ns_check_persistence (KaApplet *self)
}
-/* destroy the applet and quit */
+/* undo what was done on startup() */
void
ka_applet_destroy (KaApplet* self)
{
GList *windows, *first;
ka_dbus_disconnect ();
-
windows = gtk_application_get_windows (GTK_APPLICATION(self));
if (windows) {
first = g_list_first (windows);
@@ -1040,7 +1039,6 @@ ka_applet_destroy (KaApplet* self)
}
ka_kerberos_destroy ();
- g_object_unref (self);
}
@@ -1085,6 +1083,28 @@ ka_applet_create ()
return applet;
}
+int
+main (int argc, char *argv[])
+{
+ KaApplet *applet;
+ int ret = 0;
+
+ textdomain (PACKAGE);
+ bind_textdomain_codeset (PACKAGE, "UTF-8");
+ bindtextdomain (PACKAGE, LOCALE_DIR);
+
+ g_set_application_name (KA_NAME);
+
+ gtk_init (&argc, &argv);
+ applet = ka_applet_create ();
+ if (!applet)
+ return 1;
+
+ ret = g_application_run (G_APPLICATION(applet), argc, argv);
+ g_object_unref (applet);
+ return ret;
+}
+
/*
* vim:ts:sts=4:sw=4:et:
*/
diff --git a/src/ka-dialog.c b/src/ka-dialog.c
index e499c98..ea22404 100644
--- a/src/ka-dialog.c
+++ b/src/ka-dialog.c
@@ -1082,6 +1082,7 @@ ka_kerberos_init (KaApplet *applet)
{
gboolean ret;
+ ka_secmem_init ();
ret = ka_krb5_context_init (applet);
ka_nm_init ();
g_timeout_add_seconds (CREDENTIAL_CHECK_INTERVAL,
@@ -1104,28 +1105,6 @@ ka_kerberos_destroy ()
return TRUE;
}
-
-int
-main (int argc, char *argv[])
-{
- KaApplet *applet;
- int ret = 0;
-
- textdomain (PACKAGE);
- bind_textdomain_codeset (PACKAGE, "UTF-8");
- bindtextdomain (PACKAGE, LOCALE_DIR);
- ka_secmem_init ();
- g_set_application_name (KA_NAME);
-
- gtk_init (&argc, &argv);
- applet = ka_applet_create ();
- if (!applet)
- return 1;
-
- ret = g_application_run (G_APPLICATION(applet), argc, argv);
- return ret;
-}
-
/*
* vim:ts=4:sts=4:sw=4:et:
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]