policykit-gnome r98 - trunk/src



Author: davidz
Date: Sat Jan 31 20:43:18 2009
New Revision: 98
URL: http://svn.gnome.org/viewvc/policykit-gnome?rev=98&view=rev

Log:
update to latest polkitagent API (registration can now fail)



Modified:
   trunk/src/main.c

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Sat Jan 31 20:43:18 2009
@@ -36,6 +36,7 @@
   gint ret;
   GMainLoop *loop;
   PolkitAgentListener *listener;
+  GError *error;
 
   g_type_init ();
   gtk_init (&argc, &argv);
@@ -48,18 +49,28 @@
 
   ret = 1;
 
-  listener = polkit_gnome_listener_new ();
+  loop = g_main_loop_new (NULL, FALSE);
 
-  polkit_agent_export_listener (listener, NULL, "/org/gnome/PolicyKit1/AuthenticationAgent");
+  listener = polkit_gnome_listener_new ();
 
-  loop = g_main_loop_new (NULL, FALSE);
+  error = NULL;
+  if (!polkit_agent_register_listener (listener,
+                                       NULL,
+                                       "/org/gnome/PolicyKit1/AuthenticationAgent",
+                                       &error))
+    {
+      g_printerr ("Cannot register authentication agent: %s\n", error->message);
+      g_error_free (error);
+      goto out;
+    }
 
   g_main_loop_run (loop);
 
+  ret = 0;
+
+ out:
   g_object_unref (listener);
   g_main_loop_unref (loop);
 
-  ret = 0;
-
   return ret;
 }



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