[Vala] Some more troubles with GValues
- From: "Daniele Benucci" <d benux gmail com>
- To: "Mailing List Vala" <vala-list gnome org>
- Subject: [Vala] Some more troubles with GValues
- Date: Wed, 12 Nov 2008 18:33:56 +0100
I managed how to handle a DBus dict of {string, variant} in Vala, but now I have some troubles with GValue type as C compiler returns me some errors:
Maybe it depends on how my code is written, as I'm new to Vala and GLib types, but I really can't figure out where the problem is.
I have to extract a string value from an HashTable<string,Value> obtained with a DBus call and store it in a variable.
First try:
(1) HashTable<string,Value> properties = server.GetProperties();
(2) string address = properties.lookup("Address").get_string();
Vala compilation is successful, but C compilation fails with "incompatible types in assignment" on C instruction derived from line 2.
I tried using dup_string too, but the result is the same.
Second try: breaking up instructions
(1) HashTable<string,Value> properties = server.GetProperties();
(2) Value v = Value(typeof(string));
(3) v = properties.lookup("Address");
(4) string address = v.get_string();
Vala compilation is successful, but C compilation fails with "lvalue required as unary '&' operand" on C instruction derived from line 3.
Could someone help me to find where the problem is or with a code example? Tell me if you need some more details.
Thanks in advance
Daniele Benucci
--
Grabel's Law:
2 is not equal to 3 -- not even for large values of 2.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]