[anjuta-devel] ianjuta_project_manager_get_elements
- From: Sébastien Granjoux <seb sfo free fr>
- To: Massimo Cora' <maxcvs email it>
- Cc: anjuta-devel-list gnome org
- Subject: [anjuta-devel] ianjuta_project_manager_get_elements
- Date: Mon, 22 Nov 2010 21:45:07 +0100
Hi Massimo,
I have just looked at the ianjuta_project_manager_get_elements function
to know why it returns 0. It's because, the project is loaded in a thread.
When a project is loaded, the project manager get the on_profile_scoped
signal. In this handler, it loads the project and set the
"project_root_uri" shell value to the project directory.
The symbol-db plugin detect a change on the "project_root_uri" value and
call ianjuta_project_manager_get_elements in the
do_check_offline_files_changed function. The issue is that, at that time
the project is not loaded yet only the root node is existing.
So it's not a simple bug. I think it's better to set the
project_root_uri value at that time. Some plugins can already uses it to
do something that doesn't need all project nodes. Moreover the loaded of
the complete project could be a bit long, especially as it takes care of
loading all sources of the packages.
Then I don't what is the best solution to fix this.
I can just return an error, something like project not complete. And the
caller should handle it and call the function later. It's easy for me
but I think it's a bit rough for the caller.
There is a project loaded signal with is emitted when the project is
completely loaded. The issue is that the project can be loaded in
several steps. Currently all packages are loaded later. Do you prefer
only one "project-loaded" signal when the project is fully loaded ? Or
have a signal after each step with a complete boolean by example ?
I think having a signal after each step is better because you can get it
sooner but it's more complex to handle especially to know if a package
has been removed. Because if you don't get the package, you don't know
if it's because it's not loaded yet or if it has been removed. But, I
think it can be handled, it doesn't matter if you keep removed packages
in cache for a few seconds at the beginning.
Best Regards,
Sébastien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]