[glib/gdbus-daemon] gdbusdaemon: Handle GetNameOwner for unique ids



commit 063cde59016ef8cba1841e30092d52db2889d04b
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Apr 16 21:04:38 2012 +0200

    gdbusdaemon: Handle GetNameOwner for unique ids
    
    Without this gmenumodel fails

 gio/gdbusdaemon.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdbusdaemon.c b/gio/gdbusdaemon.c
index 6d1bd70..b3b5a87 100644
--- a/gio/gdbusdaemon.c
+++ b/gio/gdbusdaemon.c
@@ -930,6 +930,17 @@ handle_get_name_owner (_GFreedesktopDBus *object,
       return TRUE;
     }
 
+  if (arg_name[0] == ':')
+    {
+      if (g_hash_table_lookup (daemon->clients, arg_name) == NULL)
+	g_dbus_method_invocation_return_error (invocation,
+					       G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER,
+					       "Could not get owner of name '%s': no such name", arg_name);
+      else
+	_g_freedesktop_dbus_complete_get_name_owner (object, invocation, arg_name);
+      return TRUE;
+    }
+
   name = name_lookup (daemon, arg_name);
   if (name == NULL)
     {



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