From 9bc7166f81cf77b369f9610166839c0ae1aa953b Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 17 Jun 2010 20:19:23 +0800 Subject: [PATCH] Use IBUS_TYPE_OBJECT_PATH for return value of CurrentInputContext --- bus/ibusimpl.c | 4 ++-- ibus/interface/iibus.py | 2 +- src/ibusbus.c | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c index 32f6df06..ccb0cf0a 100644 --- a/bus/ibusimpl.c +++ b/bus/ibusimpl.c @@ -712,7 +712,7 @@ _ibus_introspect (BusIBusImpl *ibus, " \n" " \n" " \n" - " \n" + " \n" " \n" " \n" " \n" @@ -1255,7 +1255,7 @@ _ibus_current_input_context (BusIBusImpl *ibus, reply = ibus_message_new_method_return (message); path = ibus_service_get_path((IBusService *)ibus->focused_context); ibus_message_append_args (reply, - G_TYPE_STRING, &path, + IBUS_TYPE_OBJECT_PATH, &path, G_TYPE_INVALID); return reply; diff --git a/ibus/interface/iibus.py b/ibus/interface/iibus.py index 2c0b109e..e63caa39 100644 --- a/ibus/interface/iibus.py +++ b/ibus/interface/iibus.py @@ -53,7 +53,7 @@ class IIBus(dbus.service.Object): @method(in_signature="s", out_signature="o") def CreateInputContext(self, client_name, dbusconn): pass - @method(out_signature="s") + @method(out_signature="o") def CurrentInputContext(self, dbusconn): pass # general methods diff --git a/src/ibusbus.c b/src/ibusbus.c index 82ecbba4..40d45667 100644 --- a/src/ibusbus.c +++ b/src/ibusbus.c @@ -527,7 +527,7 @@ ibus_bus_current_input_context(IBusBus *bus) g_assert (IBUS_IS_BUS (bus)); g_return_val_if_fail (ibus_bus_is_connected (bus), NULL); - gchar *name = NULL; + gchar *path = NULL; IBusMessage *reply = NULL; IBusError *error = NULL; @@ -539,9 +539,10 @@ ibus_bus_current_input_context(IBusBus *bus) G_TYPE_INVALID); if (reply) { - if (ibus_message_get_args (reply, &error, G_TYPE_STRING, &name, + if (ibus_message_get_args (reply, &error, + IBUS_TYPE_OBJECT_PATH, &path, G_TYPE_INVALID)) { - name = g_strdup (name); + path = g_strdup (path); } else { g_warning ("%s: %s", error->name, error->message); ibus_error_free (error); @@ -550,7 +551,7 @@ ibus_bus_current_input_context(IBusBus *bus) ibus_message_unref (reply); } - return name; + return path; } static void -- 2.34.1