[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);
      
            ....blablabla...

        } catch (Error e) {

            ....blablabla...
        }
    }


My terminal output :
heimdall lianli:~/Programmation/Vala$ valac --pkg gtk+-2.0 control1.vala
-o control1
control1.c: In function «main_window_read_conf_file":
control1.c:280: erreur: too many arguments to function
«g_key_file_get_groups"
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)


If I use get_groups with no parameters, valac complain about the number
of arguments.

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


C documentation say about g_key_file_get_groups (), that the second
arguments (length) may optionally be NULL. So I suppose that the problem
isn't here.

Did you see any errors in my code ?




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