Re: [anjuta-devel] Search Dialog in Anjuta 3.2?



Hi!

It's difficult to do currently.

I think one solution would be:
1. Call ianjuta_project_manager_get_children with the GFile that you get 
from the IAnjutaProjectNodeChooser.
2. I'm quite sure, this will return only the direct children, so then 
you will have to call it again on all the children until you get NULL.
3. Then, you need to call ianjuta_project_manager_get_target_type to 
check that all these nodes are source files.

It's not convenient for sure.

I tried exactly that (well, it is a recursive call but not very
difficult) however it doesn't work because get_children() is not
implemented:

http://git.gnome.org/browse/anjuta/tree/plugins/project-manager/plugin.c#n2012


1. Just add the necessary function to IAnjutaProjectManager like
List<GFile *> ianjuta_project_manager_get_all_children (
              GFile *parent,
              AnjutaProjectNodeType type);
This function to get all children of the parent recursively with the 
defined type.
+ I think it's exactly what you need.
- It's difficult to get several type of node at the same time (target 
and source by example) but I don't know if it's really useful.
- a GFile could eventually corresponds to several project node (by 
example a source used in several targets)

Yep, that would work but I can live with the recursive solution shown
above it is implemented. In general it is only useful for nodes that can
have children like modules and groups.

One more thing, I have written the AnjutaProjectNodeChooser button in 
order to choose a parent for a new project node. By example if you use 
ANJUTA_PROJECT_SOURCE, you will get all nodes allowed as parent of a 
source file. There is one exception, if you use ANJUTA_PROJECT_ROOT, you 
will get all project nodes, it is used for properties. In your case, 
using ANJUTA_PROJECT_SOURCE by example means that you cannot select a 
group in autotools project.

I figured that out and now you can only select groups (e.g. directories)
in the find in files dialog which seems reasonable for now.

Thanks,
Johannes




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