After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666679 - Improvements to the new project API
Improvements to the new project API
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: project-manager
unspecified
Other All
: Normal normal
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-21 18:20 UTC by Abderrahim Kitouni
Modified: 2011-12-22 21:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libanjuta: set the info for the default value of a property (689 bytes, patch)
2011-12-21 18:23 UTC, Abderrahim Kitouni
accepted-commit_now Details | Review
libanjuta: add gir annotation for anjuta_project_node_insert_property_info (967 bytes, patch)
2011-12-21 18:23 UTC, Abderrahim Kitouni
reviewed Details | Review
libanjuta: don't register project property lists as GObject properties (2.73 KB, patch)
2011-12-21 18:23 UTC, Abderrahim Kitouni
accepted-commit_now Details | Review
libanjuta, am-project: better memory management for the properties lists (3.34 KB, patch)
2011-12-21 18:23 UTC, Abderrahim Kitouni
none Details | Review
language-support-vala: update .vapi for the latest changes (14.46 KB, patch)
2011-12-21 18:23 UTC, Abderrahim Kitouni
none Details | Review
language-support-vala: take advantage of the new project API (1.57 KB, patch)
2011-12-21 18:23 UTC, Abderrahim Kitouni
reviewed Details | Review
libanjuta, am-project, project-manager, language-support-vala: rename property to default_value (13.30 KB, patch)
2011-12-22 20:36 UTC, Abderrahim Kitouni
none Details | Review

Description Abderrahim Kitouni 2011-12-21 18:20:35 UTC
Here are my proposed changes to the new project API, and an example for using it from 
vala (I'd like to know your opinion on this use). With these I think it's possible to 
write project backend plugins in both python and vala (I'll push the updated buildj 
plugin to bitbucket shortly, and I'll try to write a sample python plugin)
Comment 1 Abderrahim Kitouni 2011-12-21 18:23:18 UTC
Created attachment 204050 [details] [review]
libanjuta: set the info for the default value of a property
Comment 2 Abderrahim Kitouni 2011-12-21 18:23:24 UTC
Created attachment 204051 [details] [review]
libanjuta: add gir annotation for anjuta_project_node_insert_property_info
Comment 3 Abderrahim Kitouni 2011-12-21 18:23:30 UTC
Created attachment 204052 [details] [review]
libanjuta: don't register project property lists as GObject properties
Comment 4 Abderrahim Kitouni 2011-12-21 18:23:38 UTC
Created attachment 204053 [details] [review]
libanjuta, am-project: better memory management for the properties lists

properties is now owned fully by the node, while only the list
properties_info (not its content) is owned by tho node.
Comment 5 Abderrahim Kitouni 2011-12-21 18:23:45 UTC
Created attachment 204054 [details] [review]
language-support-vala: update .vapi for the latest changes
Comment 6 Abderrahim Kitouni 2011-12-21 18:23:53 UTC
Created attachment 204055 [details] [review]
language-support-vala: take advantage of the new project API
Comment 7 Sébastien Granjoux 2011-12-22 19:58:45 UTC
Review of attachment 204051 [details] [review]:

Shouldn't it be (transfer full) for the info argument as the list doesn't copy the data?
Comment 8 Sébastien Granjoux 2011-12-22 20:16:22 UTC
Review of attachment 204055 [details] [review]:

get_property always return a valid property, it could be a custom property or the default property. Property can be NULL only if you use an invalid id for this node.

I have the same issue in the autotools backend. When I want to check that a node has its own property, I'm rather using something like ((property != NULL) && (property != property->info->property)). It's a bit cumbersome, perhaps we can find something better. But it's useful to get a valid property from a node even if the node hasn't its own value.
Comment 9 Abderrahim Kitouni 2011-12-22 20:36:50 UTC
Created attachment 204112 [details] [review]
libanjuta, am-project, project-manager, language-support-vala: rename property to default_value
Comment 10 Abderrahim Kitouni 2011-12-22 20:50:12 UTC
(In reply to comment #7)
> Review of attachment 204051 [details] [review]:
> 
> Shouldn't it be (transfer full) for the info argument as the list doesn't copy
> the data?

It is done like this for patch 204053 (the node owns the list, but not the properties information; and those could be kept in one place in a static/class variable). If this becomes (transfer full), patch 204053 needs to change as well.
Comment 11 Abderrahim Kitouni 2011-12-22 20:51:02 UTC
(In reply to comment #8)
> Review of attachment 204055 [details] [review]:
> 
> get_property always return a valid property, it could be a custom property or
> the default property. Property can be NULL only if you use an invalid id for
> this node.
> 
> I have the same issue in the autotools backend. When I want to check that a
> node has its own property, I'm rather using something like ((property != NULL)
> && (property != property->info->property)). It's a bit cumbersome, perhaps we
> can find something better. But it's useful to get a valid property from a node
> even if the node hasn't its own value.

Thanks, I'll fix this.
Comment 12 Abderrahim Kitouni 2011-12-22 21:10:39 UTC
I've pushed all the above patches (with a fix for patch 204055)
Comment 13 Sébastien Granjoux 2011-12-22 21:15:59 UTC
Review of attachment 204050 [details] [review]:

Ok.
Comment 14 Sébastien Granjoux 2011-12-22 21:16:18 UTC
Review of attachment 204052 [details] [review]:

Ok