diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2021-07-04 20:55:30 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2021-07-04 20:55:30 (GMT) |
commit | 59febc74741332fec4df71962fe9174d511df384 (patch) | |
tree | e8d8004506850ebb168ef7ba0aacdeeeaa0f749c /src/analysis/project.c | |
parent | 5958d9b25f806df73cd0634de2c9475eb6497e8c (diff) |
Save all needed information into project files.
Diffstat (limited to 'src/analysis/project.c')
-rw-r--r-- | src/analysis/project.c | 67 |
1 files changed, 1 insertions, 66 deletions
diff --git a/src/analysis/project.c b/src/analysis/project.c index 13985f3..b57afc7 100644 --- a/src/analysis/project.c +++ b/src/analysis/project.c @@ -381,14 +381,8 @@ bool g_study_project_save(GStudyProject *project, const char *filename) xmlDocPtr xdoc; /* Document XML à créer */ xmlXPathContextPtr context; /* Contexte pour les recherches*/ const char *final; /* Lieu d'enregistrement final */ - size_t root_count; /* Quantité d'origines */ size_t i; /* Boucle de parcours */ - GBinContent *content; /* Contenu brut à manipuler */ - GBinContent *root; /* Contenu d'origine à traiter */ - const gchar *hash; /* Empreinte d'un contenu */ char *access; /* Chemin pour une sous-config.*/ - xmlXPathObjectPtr xobject; /* Cible d'une recherche */ - char *format; /* Format associé à un élément */ /* Forme générale */ @@ -401,85 +395,26 @@ bool g_study_project_save(GStudyProject *project, const char *filename) result = add_string_attribute_to_node(xdoc, context, "/ChrysalideProject", "version", PROJECT_XML_VERSION); if (result) - result = (ensure_node_exist(xdoc, context, "/ChrysalideProject/RootContents") != NULL); - - if (result) result = (ensure_node_exist(xdoc, context, "/ChrysalideProject/LoadedContents") != NULL); final = filename != NULL ? filename : project->filename; /* Inscriptions des contenus */ - root_count = 0; - g_study_project_lock_contents(project); for (i = 0; i < project->count && result; i++) { - content = g_loaded_content_get_content(project->contents[i]); - - /* Racine */ - - root = g_binary_content_get_root(content); - - hash = g_binary_content_get_checksum(root); - - asprintf(&access, "/ChrysalideProject/RootContents/Content[@hash='%s']", hash); - - xobject = get_node_xpath_object(context, access); - - free(access); - - if (XPATH_OBJ_NODES_COUNT(xobject) == 0) - { - asprintf(&access, "/ChrysalideProject/RootContents/Content[position()=%zu]", ++root_count); - - if (result) - result = (ensure_node_exist(xdoc, context, access) != NULL); - - if (result) - { - hash = g_binary_content_get_checksum(content); - result = add_string_attribute_to_node(xdoc, context, access, "hash", hash); - } - - if (result) - result = g_binary_content_save(root, xdoc, context, access, final); - - free(access); - - } - - if(xobject != NULL) - xmlXPathFreeObject(xobject); - - /* Charge utile */ - asprintf(&access, "/ChrysalideProject/LoadedContents/Content[position()=%zu]", i + 1); if (result) result = (ensure_node_exist(xdoc, context, access) != NULL); if (result) - { - hash = g_binary_content_get_checksum(content); - result = add_string_attribute_to_node(xdoc, context, access, "hash", hash); - } - - if (result) - { - format = g_loaded_content_get_format_name(project->contents[i]); - result = add_string_attribute_to_node(xdoc, context, access, "format", format); - free(format); - } - - if (result) result = g_loaded_content_save(project->contents[i], xdoc, context, access); free(access); - g_object_unref(G_OBJECT(content)); - } g_study_project_unlock_contents(project); @@ -1093,7 +1028,7 @@ static GLoadingHandler *g_loading_handler_new_recovering(GStudyProject *project, { asprintf(&access, "/ChrysalideProject/RootContents/Content[position()=%zu]", i + 1); - content = g_binary_content_new_from_xml(context, access, project->filename); + content = NULL;//g_binary_content_new_from_xml(context, access, project->filename); free(access); |