Re: returning a string to d-bus
- From: Tomas Carnecky <tom dbservice com>
- To: Luka Napotnik <luka napotnik gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: returning a string to d-bus
- Date: Wed, 06 Aug 2008 13:28:32 +0200
Luka Napotnik wrote:
Hello.
I have a D-BUS listener with a GObject method which should send a string
back to D-BUS. My d-bus listener method is:
gboolean
some_object_get_name(GObject *object, gchar *str, GError **error)
{
str = g_strdup("Hello");
return TRUE;
}
But when the client connect to this d-bus interface and calls the
get_name() method, the method doesn't return the string. I'm guessing
I'm passing the string the wrong way. Please help.
You probably want:
gboolean
some_object_get_name(GObject *object, gchar **str, GError **error)
{
*str = g_strdup("Hello");
return TRUE
}
and call that function this way:
gchar *str = NULL;
if (some_object_get_name(object, &str, &error) == TRUE)
gprintf("name: %s\n", str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]