Re: [anjuta-devel] New project interface and introspection



Hello Sébastien,

في س، 09-10-2010 عند 19:01 +0200 ، كتب Sébastien Granjoux:
Hi,

Le 09/10/2010 15:04, Abderrahim Kitouni a écrit :
Well, as I understand it, the project manager uses a GFile to identify
nodes, so I expect every file to map to exactly one node.

It's not true for a source file used in several targets. Each target 
will have its own source node, but all these source nodes will have the 
same GFile. It can be a different GFile object but corresponding to the 
same file. But I hesitate to consider as different two GFile objects 
corresponding to the same file.
I see. But then, how is ianjuta_project_manager_get_parent supposed to
work? 


I think this is the best option : the backend already has to take care
because it can be called from multiple threads, so having it implement
it's own threading is better (and it can even implement that using
processes, as it is recommended for python). And for simple,
machine-friendly formats, the backend may skip explicit threading
altogether, and just use e.g g_file_load_contents in order not to block
(btw, I meant g_file_load_contents_async) 
the GUI.

I change my mind and I'm agree with this.
So what's exactly needed for this?
I'm not sure, but it seems that only changes needed in IAnjutaProject
interface is removing the return value of all functions but get_root and
get_node_info, and adding signals: property-updated and maybe
node-{added,removed,saved}. What do you think?

Or should we use callbacks instead? Using callbacks makes it easier to
send multiple request to the backend and then process responses (there
isn't the problem of "which request triggered this response?"), but if
all that's needed for further processing is the new/updated node, it
will be easier to just use signals.



I have not completely decided yet. But the new API is easier to use, so 
I think it rather makes sense to expose it to other plugin and remove 
most of the project manager interface.
Ok.


Yes, that's right. The backend can even load the project without using 
thread.
Of course.


When the changes are done inside Anjuta, the project manager calls
add_node_before or add_node_after and then (immediately?) calls
save_node in which the backend is responsible for writing out the
modified nodes."

Yes. It can be possible that any plugin can call add_node_before or 
add_node_after and then save_node. It can be possible to call several 
times add_node before calling save_node
Yes, but right now, no other plugin can access the backend directly. So
we need to add a get_current_project method to the project manager.
But then, a potential problem with signals is that one plugin may get a
signal that's not related to the operation it has requested, and thus
wrongly assume its operation has finished.


I've also attached a couple patches to the following bug (mostly g-i
related) : https://bugzilla.gnome.org/show_bug.cgi?id=631952

Regards,
Abderrahim




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