static gboolean pm_command_load_complete (AnjutaPmProject *project, AnjutaProjectNode *node, GError *error) { gboolean complete = FALSE; //g_message ("pm_command_load_complete %p", node); if (error == NULL) { if (project->root == node) { project->incomplete_node = 0; } // Check for incompletely loaded object and load them if (anjuta_project_node_get_state (node) & ANJUTA_PROJECT_INCOMPLETE) { project->incomplete_node--; //g_message ("remaining node %d", project->incomplete_node); } anjuta_project_node_clear_state (node, ANJUTA_PROJECT_LOADING | ANJUTA_PROJECT_INCOMPLETE); anjuta_project_node_foreach (node, G_POST_ORDER, (AnjutaProjectNodeForeachFunc)on_pm_project_load_incomplete, project); complete = !project->loaded && (project->incomplete_node == 0); if (complete) project->loaded = TRUE; } //g_message ("pm_command_load_complete %d is loaded %d", complete, ianjuta_project_is_loaded (project->project, NULL)); g_signal_emit (G_OBJECT (project), signals[LOADED], 0, node, complete, error); return TRUE; }
static void on_pm_project_load_incomplete (AnjutaProjectNode *node, AnjutaPmProject *project) { gint state = anjuta_project_node_get_state (node); /* Get capabilities for all existing node */ project->node_capabilities |= state; if ((state & ANJUTA_PROJECT_INCOMPLETE) && !(state & ANJUTA_PROJECT_LOADING)) { //g_message ("incomplete node %s", anjuta_project_node_get_name (node)); project->incomplete_node++; anjuta_project_node_set_state (node, ANJUTA_PROJECT_LOADING); //g_message ("load incomplete %p", node); ianjuta_project_load_node (project->project, node, NULL); } }
static void list_children (IAnjutaProject *project, AnjutaProjectNode *root, AnjutaProjectNode *parent, gint indent, const gchar *path) { AnjutaProjectNode *node; guint count; indent++; count = 0; for (node = anjuta_project_node_first_child (parent); node != NULL; node = anjuta_project_node_next_sibling (node)) { if (anjuta_project_node_get_state (node) & ANJUTA_PROJECT_REMOVED) continue; if (anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_MODULE) { gchar *child_path = g_strdup_printf ("%s%s%d", path != NULL ? path : "", path != NULL ? ":" : "", count); list_module (project, root, node, indent, child_path); g_free (child_path); } count++; } count = 0; for (node = anjuta_project_node_first_child (parent); node != NULL; node = anjuta_project_node_next_sibling (node)) { if (anjuta_project_node_get_state (node) & ANJUTA_PROJECT_REMOVED) continue; if (anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_PACKAGE) { gchar *child_path = g_strdup_printf ("%s%s%d", path != NULL ? path : "", path != NULL ? ":" : "", count); list_package (project, root, node, indent, child_path); g_free (child_path); } count++; } count = 0; for (node = anjuta_project_node_first_child (parent); node != NULL; node = anjuta_project_node_next_sibling (node)) { if (anjuta_project_node_get_state (node) & ANJUTA_PROJECT_REMOVED) continue; if (anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_GROUP) { gchar *child_path = g_strdup_printf ("%s%s%d", path != NULL ? path : "", path != NULL ? ":" : "", count); list_group (project, root, node, indent, child_path); g_free (child_path); } count++; } count = 0; for (node = anjuta_project_node_first_child (parent); node != NULL; node = anjuta_project_node_next_sibling (node)) { if (anjuta_project_node_get_state (node) & ANJUTA_PROJECT_REMOVED) continue; if (anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_TARGET) { gchar *child_path = g_strdup_printf ("%s%s%d", path != NULL ? path : "", path != NULL ? ":" : "", count); list_target (project, root, node, indent, child_path); g_free (child_path); } count++; } count = 0; for (node = anjuta_project_node_first_child (parent); node != NULL; node = anjuta_project_node_next_sibling (node)) { if (anjuta_project_node_get_state (node) & ANJUTA_PROJECT_REMOVED) continue; if (anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_SOURCE) { gchar *child_path = g_strdup_printf ("%s%s%d", path != NULL ? path : "", path != NULL ? ":" : "", count); list_source (project, root, node, indent, child_path); g_free (child_path); } count++; } }