diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-12-24 16:26:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-12-24 16:26:51 (GMT) |
commit | 93dfdc30d815629a7e0c9393f0e8f0462844ff56 (patch) | |
tree | 8fe59f8c0186871ffd79873ec20905bf39170528 /src/gui/panels/bintree.c | |
parent | c388ad8910dbb1a3c478176d8b1ab3142fdbd9d5 (diff) |
Ported the panel update mechanisms to the Python API.
Diffstat (limited to 'src/gui/panels/bintree.c')
-rw-r--r-- | src/gui/panels/bintree.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/panels/bintree.c b/src/gui/panels/bintree.c index db5e774..c31bd88 100644 --- a/src/gui/panels/bintree.c +++ b/src/gui/panels/bintree.c @@ -190,7 +190,7 @@ struct _bintree_update_data static bool is_bintree_column_matching(const bintree_update_data *, GBinPortion *, gint, regmatch_t *); /* Prépare une opération de mise à jour de panneau. */ -static const char *g_bintree_panel_setup(const GBintreePanel *, unsigned int, size_t *, bintree_update_data **); +static bool g_bintree_panel_setup(const GBintreePanel *, unsigned int, size_t *, bintree_update_data **, char **); /* Bascule l'affichage d'un panneau avant mise à jour. */ static void g_bintree_panel_introduce(const GBintreePanel *, unsigned int, bintree_update_data *); @@ -202,7 +202,7 @@ static void g_bintree_panel_process(const GBintreePanel *, unsigned int, GtkStat static void g_bintree_panel_conclude(GBintreePanel *, unsigned int, bintree_update_data *); /* Supprime les données dynamiques utilisées à la mise à jour. */ -static void g_bintree_panel_clean_data(GUpdatablePanel *, unsigned int, bintree_update_data *); +static void g_bintree_panel_clean_data(const GUpdatablePanel *, unsigned int, bintree_update_data *); @@ -1132,24 +1132,27 @@ static bool is_bintree_column_matching(const bintree_update_data *data, GBinPort * uid = identifiant de la phase de traitement. * * count = nombre d'étapes à prévoir dans le traitement. [OUT] * * data = données sur lesquelles s'appuyer ensuite. [OUT] * +* msg = description du message d'information. [OUT] * * * * Description : Prépare une opération de mise à jour de panneau. * * * -* Retour : Description du message d'information. * +* Retour : Bilan de la préparation. * * * * Remarques : - * * * ******************************************************************************/ -static const char *g_bintree_panel_setup(const GBintreePanel *panel, unsigned int uid, size_t *count, bintree_update_data **data) +static bool g_bintree_panel_setup(const GBintreePanel *panel, unsigned int uid, size_t *count, bintree_update_data **data, char **msg) { - const char *result; /* Message à retourner */ + bool result; /* Bilan à retourner */ #ifndef NDEBUG int ret; /* Bilan de mise en place */ #endif GtkBuilder *builder; /* Constructeur utilisé */ GtkTreeView *treeview; /* Arborescence graphique */ + result = true; + *data = malloc(sizeof(bintree_update_data)); switch (uid) @@ -1159,7 +1162,7 @@ static const char *g_bintree_panel_setup(const GBintreePanel *panel, unsigned in *count = 0; (*data)->count = 0; - result = _("Loading portions contained in the binary format..."); + *msg = strdup(_("Loading portions contained in the binary format...")); break; @@ -1168,20 +1171,20 @@ static const char *g_bintree_panel_setup(const GBintreePanel *panel, unsigned in *count = panel->count; (*data)->count = panel->count; - result = _("Filtering portions contained in the binary format..."); + *msg = strdup(_("Filtering portions contained in the binary format...")); break; default: /* Pour GCC... */ assert(false); - result = ""; + result = false; break; } if (G_PANEL_ITEM(panel)->filter != NULL) { - (*data)->filter = (regex_t *)malloc(sizeof(regex_t)); + (*data)->filter = malloc(sizeof(regex_t)); #ifndef NDEBUG ret = regcomp((*data)->filter, G_PANEL_ITEM(panel)->filter, REG_EXTENDED | REG_ICASE); @@ -1375,7 +1378,7 @@ static void g_bintree_panel_conclude(GBintreePanel *panel, unsigned int uid, bin * * ******************************************************************************/ -static void g_bintree_panel_clean_data(GUpdatablePanel *panel, unsigned int uid, bintree_update_data *data) +static void g_bintree_panel_clean_data(const GUpdatablePanel *panel, unsigned int uid, bintree_update_data *data) { size_t i; /* Boucle de parcours */ |