[krb5-auth-dialog] enhance error message for UI xml loading



commit 3b00f2ad157ca80259c24e5490bea6fee7927eaa
Author: Guido Günther <agx sigxcpu org>
Date:   Mon Sep 7 17:04:44 2009 +0200

    enhance error message for UI xml loading

 src/krb5-auth-applet.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/krb5-auth-applet.c b/src/krb5-auth-applet.c
index 9b78bce..4778908 100644
--- a/src/krb5-auth-applet.c
+++ b/src/krb5-auth-applet.c
@@ -805,6 +805,8 @@ KaApplet*
 ka_applet_create()
 {
 	KaApplet* applet = ka_applet_new();
+	GError *error = NULL;
+	gboolean ret;
 
 	if (!(ka_applet_setup_icons (applet)))
 		g_error ("Failure to setup icons");
@@ -817,9 +819,14 @@ ka_applet_create()
 	                  G_CALLBACK (ka_applet_cb_show_trayicon), NULL);
 
 	applet->priv->uixml = gtk_builder_new();
-	g_assert(gtk_builder_add_from_file(applet->priv->uixml,
-					   KA_DATA_DIR G_DIR_SEPARATOR_S
-				           PACKAGE ".xml", NULL));
+	ret = gtk_builder_add_from_file(applet->priv->uixml,
+					KA_DATA_DIR G_DIR_SEPARATOR_S
+				        PACKAGE ".xml", &error);
+	if (!ret) {
+		g_assert (error);
+		g_assert (error->message);
+		g_error ("Failed to load UI XML: %s", error->message);
+	}
 	applet->priv->pwdialog = ka_pwdialog_create(applet->priv->uixml);
 	g_return_val_if_fail (applet->priv->pwdialog != NULL, NULL);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]