[Vala] DBus GValue trouble
- From: Sebastian Spaeth <sebastian sspaeth de>
- To: vala-list gnome org
- Subject: [Vala] DBus GValue trouble
- Date: Sat, 28 Mar 2009 08:48:22 +0100
I call a DBus Method "GetValue" which has a return signature of 'v'
(variant) (which in this special case contains a string). However, I
can't get the return value due to errors:
GLib-GObject-WARNING **: gvalue.c:185: cannot initialize GValue with
type `gchararray', the value has already been initialized as `(null)'
It seems the GValue (I also tried 'Value?') is wrongly initialized or
something. I am a bit at a loss, being somewhat of a GLib newbie.
See the couple of lines that do the call in Vala and translated to C.
THanks for any pointer.
spaetz
-------------------------------------------------------------------
VALA CODE
dynamic DBus.Object dbus_pro_set
dbus_profile = dbus.get_object ("org.freesmartphone.opreferencesd",
"/org/freesmartphone/Preferences",
"org.freesmartphone.Preferences");
Value val = dbus_pro_set.GetValue (str);
debug(val.type().name());
debug("str: %s", val.get_string());
-----------------------------------------------------------------
C CODE WHICH RETURNS THE ERROR:
GValue _dynamic_GetValue17 (DBusGProxy* self, const char* param1,
GError** error) {
GValue result;
dbus_g_proxy_call (self, "GetValue", error, G_TYPE_STRING, param1,
G_TYPE_INVALID, G_TYPE_VALUE, &result, G_TYPE_INVALID);
if (*error) {
return;
}
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]