Re: [Vala] Question about the number of g_key_file_get_groups() arguments




Hi everybody,

 I've got a problem for reading key "ini-like" file. I suppose I'm not
 doing "thing" right, but please take a look, maybe a miss something :

    //Read configuration file
    public void read_conf_file(string conf_file){

        try {
            var conf_key = new GLib.KeyFile();
            conf_key.load_from_file(conf_file, GLib.KeyFileFlags.NONE);
            string[] key_group = conf_key.get_groups(null);
    

This method doesn't take any arguments, so in Vala simply write
nothing between the parentheses:

string[] key_groups = key_file.get_groups();

That works fine.

  
Sorry but it doesn't work. With no arguments, valac complain...

var conf_key = new GLib.KeyFile();
conf_key.load_from_file(conf_file, GLib.KeyFileFlags.NONE);
string[] key_groups = conf_key.get_groups();

Here my terminal output :
heimdall lianli:~/Programmation/Vala$ valac --pkg gtk+-2.0 control1.vala
-o control1
/home/heimdall/Programmation/Vala/control1.vala:124.26-124.44: error:
Too few arguments, method `null' does not take 0 arguments
Compilation failed: 1 error(s), 0 warning(s)

Line 124 is  : string[] key_groups = conf_key.get_groups();

I use Vala 0.1.6
Did you think that it's an issue fixed in Vala 0.1.7 ??





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]