diff options
Diffstat (limited to 'src/analysis/project.c')
| -rw-r--r-- | src/analysis/project.c | 79 | 
1 files changed, 10 insertions, 69 deletions
| diff --git a/src/analysis/project.c b/src/analysis/project.c index 13985f3..9a5e4e2 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); @@ -1314,12 +1249,12 @@ static void on_new_content_resolved(GContentResolver *resolver, wgroup_id_t wid,                  hash = g_binary_content_get_checksum(content);                  g_object_unref(G_OBJECT(content)); -                format = g_loaded_content_get_format_name(available[i]); +                format = "FIXME";//g_loaded_content_get_format_name(available[i]);                  asprintf(&access, "/ChrysalideProject/LoadedContents/Content[@hash='%s' and @format='%s']",                           hash, format); -                free(format); +                //free(format);                  xobject = get_node_xpath_object(handler->context, access); @@ -1374,7 +1309,7 @@ static void on_new_content_resolved(GContentResolver *resolver, wgroup_id_t wid,                          /**                           * S'il s'agit des résultats de la dernière exploration,                           * alors les groupes contenant les éléments chargés vont -                         * être libéré, potentiellement pendant l'analyse. +                         * être libérés, potentiellement pendant l'analyse.                           *                           * On temporise en incrémentant les références.                           */ @@ -1430,6 +1365,9 @@ static void on_new_content_resolved(GContentResolver *resolver, wgroup_id_t wid,  /* ---------------------------------------------------------------------------------- */ +#ifdef INCLUDE_GTK_SUPPORT + +  /******************************************************************************  *                                                                             *  *  Paramètres  : -                                                            * @@ -1502,3 +1440,6 @@ void push_project_into_recent_list(const GStudyProject *project)      g_generic_config_set_value(get_main_configuration(), MPK_LAST_PROJECT, project->filename);  } + + +#endif | 
