[anjuta-devel] New project notification
- From: Sébastien Granjoux <seb sfo free fr>
- To: Massimo Cora' <maxcvs email it>
- Cc: anjuta-devel-list gnome org
- Subject: [anjuta-devel] New project notification
- Date: Sat, 05 Feb 2011 17:26:53 +0100
Hi Massimo,
While using the new makefile plugin, I have hit one issue with the
project manager. There are now several ways to know when a new project
is loaded.
1. Checking the shell variable IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI
for changes:
This is the old way of doing it, which is working with the old project
manager. This variable is set when the project URI is known before
having it fully loaded.
2. Checking the shell variable IANJUTA_PROJECT_MANAGET_CURRENT_PROJECT
for changes:
This is a new way to get the same information. Instead of an URI, you
get a complete IAnjutaProject object allowing you to directly access all
functions of the project. This variable is set just before setting the
project URI variable above, before having the project fully loaded.
3. Connect to the project manager signal "project-loaded".
This is a new signal provided by the new project manager. This signal is
emitted when the project is completely loaded.
So the issue with the makefile backend was that you get these
notifications in the order 3 (project is loaded synchronously) 1 2. It
was leading to a crash in symbol-db plugin which was checking for
IANJUTA_PROJECT_MANAGET_ROOT_URI in the "project-loaded" handler.
I have avoid this crash by changing the order to 2 1 3. But there is
still an issue if you connect to a change of
IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT and try to read
IANJUTA_PROJECT_MANAGER_ROOT_URI.
It is not very nice, I can imagine the following solutions:
1. Do nothing:
We just need to document that IANJUTA_PROJECT_MANAGER_ROOT_URI could
still be NULL after getting a change on
IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT
2. Remove IANJUTA_PROJECT_MANAGER_ROOT_URI:
We can do the same by using IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT,
getting the file corresponding to the root node. All plugins using this
value have to be updated.
3. Remove both shelll variables and add a new signal something like
"project-changed":
This signal can be emitted when the current project is changed before
loading it.
4. Do you have another idea?
I think, it could be better to something between 1 and 2. I mean telling
that the IANJUTA_PROJECT_MANAGER_ROOT_URI variable is obsolete and try
to use only IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT. This is looking
more like the document manager. Then, it would be useful to avoid using
IANJUTA_PROJECT_MANAGER_ROOT_URI in various plugins.
Regards,
Sébastien
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]