Re: [anjuta-devel] Rethinking the AnjutaProjectNode API

Hi Abderrahim,

Le 13/08/2011 16:28, Abderrahim Kitouni a écrit :
As a user (the Vala support plugin), I just did what I wanted to do when
we were discussing the API in the first place, and it seems to work
perfectly. I have used anjuta_project_source_get_node_from_file and
anjuta_project_node_parent_type which weren't used. I think the former
(along with similar functions anjuta_project_group_get_node_from_file
and anjuta_project_target_get_node_from_name) should be correctly
namespaced as anjuta_project_node_get_{source,group}_from_file and
anjuta_project_node_get_target_from_name (or maybe something else).

The issue here is that I could have several node corresponding to the same file. By example if the same source file is used by a several targets.

I don't really know how to handle this case. Returning only one node as it is done currently looses some information. On the other hand, returning a list of nodes is more complex and it wasn't useful in the use cases that I have seen.

Then, another issue is that I want to be able to add new type of nodes and it would be better if I don't need to add new API functions too.

Now I'd like to get the VALAFLAGS of a given target, and I can't find a
way to do so except to traverse the custom_properties list matching the
name field against something like "Vala compiler flags:" which looks
more like a user interface string than a machine-friendly one.

In my idea, you have to match it against "Vala compiler flags:". This is already and ID string, it is just more obvious for the translator to get the expected translation. We could add another string like "VALAFLAGS" which is not translated though.

I have already get this problem inside the autotool plugin and I have solved it by using the additional members of an autotools property. Obviously you cannot use this "solution" outside.

> There are also some other problems with the memory
management of the properties lists but I could hack around them, so
let's start with more urgent things.




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