summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/history.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/gui/panels/history.c b/src/gui/panels/history.c
index a1aa36b..9edd32e 100644
--- a/src/gui/panels/history.c
+++ b/src/gui/panels/history.c
@@ -272,9 +272,9 @@ GPanelItem *g_history_panel_new(void)
static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedContent *old, GLoadedContent *new)
{
GLoadedBinary *binary; /* Autre version de l'instance */
- GList *collections; /* Ensemble de collections */
- GList *c; /* Boucle de parcours #1 */
- GDbCollection *collec; /* Collection visée manipulée */
+ GDbCollection **collections; /* Ensemble de collections */
+ size_t count; /* Taille de cet ensemble */
+ size_t k; /* Boucle de parcours #1 */
GtkBuilder *builder; /* Constructeur utilisé */
GtkListStore *store; /* Modèle de gestion */
GList *items; /* Liste des éléments groupés */
@@ -291,17 +291,16 @@ static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedCo
if (panel->binary != NULL)
{
- collections = g_loaded_binary_get_all_collections(panel->binary);
+ collections = g_loaded_binary_get_all_collections(panel->binary, &count);
- rlock_collections(collections);
-
- for (c = g_list_first(collections); c != NULL; c = g_list_next(c))
+ for (k = 0; k < count; k++)
{
- collec = G_DB_COLLECTION(c->data);
- g_signal_handlers_disconnect_by_func(collec, G_CALLBACK(on_history_changed), panel);
+ g_signal_handlers_disconnect_by_func(collections[k], G_CALLBACK(on_history_changed), panel);
+ g_object_unref(G_OBJECT(collections[k]));
}
- runlock_collections(collections);
+ if (collections != NULL)
+ free(collections);
g_object_unref(G_OBJECT(panel->binary));
@@ -324,14 +323,13 @@ static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedCo
/* Actualisation de l'affichage */
- collections = g_loaded_binary_get_all_collections(binary);
-
- rlock_collections(collections);
+ collections = g_loaded_binary_get_all_collections(binary, &count);
- for (c = g_list_first(collections); c != NULL; c = g_list_next(c))
+ for (k = 0; k < count; k++)
{
- collec = G_DB_COLLECTION(c->data);
- items = g_db_collection_list_items(collec);
+ g_db_collection_rlock(collections[k]);
+
+ items = g_db_collection_list_items(collections[k]);
for (i = g_list_first(items); i != NULL; i = g_list_next(i))
{
@@ -347,12 +345,15 @@ static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedCo
}
- g_signal_connect_to_main(collec, "content-changed", G_CALLBACK(on_history_changed), panel,
+ g_signal_connect_to_main(collections[k], "content-changed", G_CALLBACK(on_history_changed), panel,
g_cclosure_user_marshal_VOID__ENUM_OBJECT);
+ g_object_unref(G_OBJECT(collections[k]));
+
}
- runlock_collections(collections);
+ if (collections != NULL)
+ free(collections);
/* Force une sélection initiale */
on_history_changed(NULL, DBA_COUNT, NULL, panel);