[vala] D-Bus: Support registering objects with low-level connections
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] D-Bus: Support registering objects with low-level connections
- Date: Fri, 26 Jun 2009 13:27:05 +0000 (UTC)
commit 49e0f33b5dc6c61c4cddcc9fcea4bbe1d3aa38e1
Author: Jürg Billeter <j bitron ch>
Date: Fri Jun 26 15:25:45 2009 +0200
D-Bus: Support registering objects with low-level connections
codegen/valadbusservermodule.vala | 9 +++++++--
vapi/dbus-glib-1.vapi | 5 +++--
2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valadbusservermodule.vala b/codegen/valadbusservermodule.vala
index bba546e..225ab2a 100644
--- a/codegen/valadbusservermodule.vala
+++ b/codegen/valadbusservermodule.vala
@@ -1401,7 +1401,8 @@ internal class Vala.DBusServerModule : DBusClientModule {
public override void visit_method_call (MethodCall expr) {
var mtype = expr.call.value_type as MethodType;
- if (mtype == null || mtype.method_symbol.get_cname () != "dbus_g_connection_register_g_object") {
+ if (mtype == null || (mtype.method_symbol.get_cname () != "dbus_connection_register_g_object" &&
+ mtype.method_symbol.get_cname () != "dbus_g_connection_register_g_object")) {
base.visit_method_call (expr);
return;
}
@@ -1422,7 +1423,11 @@ internal class Vala.DBusServerModule : DBusClientModule {
var obj_arg = args_it.get ();
var cregister = new CCodeFunctionCall (new CCodeIdentifier ("_vala_dbus_register_object"));
- cregister.add_argument (raw_conn);
+ if (mtype.method_symbol.get_cname () == "dbus_g_connection_register_g_object") {
+ cregister.add_argument (raw_conn);
+ } else {
+ cregister.add_argument ((CCodeExpression) ma.inner.ccodenode);
+ }
cregister.add_argument ((CCodeExpression) path_arg.ccodenode);
cregister.add_argument ((CCodeExpression) obj_arg.ccodenode);
expr.ccodenode = cregister;
diff --git a/vapi/dbus-glib-1.vapi b/vapi/dbus-glib-1.vapi
index cf62ae7..cda3179 100644
--- a/vapi/dbus-glib-1.vapi
+++ b/vapi/dbus-glib-1.vapi
@@ -1,6 +1,6 @@
/* dbus-glib-1.vala
*
- * Copyright (C) 2007-2008 Jürg Billeter
+ * Copyright (C) 2007-2009 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -40,6 +40,8 @@ namespace DBus {
public void setup_with_main (GLib.MainContext? context = null);
[CCode (cname = "dbus_connection_get_g_connection")]
public Connection get_g_connection ();
+ [CCode (cname = "dbus_connection_register_g_object")]
+ public void register_object (string at_path, GLib.Object object);
}
[CCode (cname = "DBusError", cprefix = "dbus_error_", destroy_function = "dbus_error_free")]
@@ -92,7 +94,6 @@ namespace DBus {
public struct Bus {
[CCode (cname = "dbus_g_bus_get")]
public static Connection get (BusType type) throws Error;
-
}
[Compact]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]