summaryrefslogtreecommitdiff
path: root/src/gui/panels/history.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-09-11 22:08:42 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-09-11 22:08:42 (GMT)
commit1c2949f6828b995c7b9f8feba8fd7214f52f8f4d (patch)
tree0bdff13f6ac8d87725d6783a2f1ecc7511426cd1 /src/gui/panels/history.c
parent83faef9c8f78b20cb031af686f763cfb215cf9d7 (diff)
Built suitable dynamic labels for bookmarks.
Diffstat (limited to 'src/gui/panels/history.c')
-rw-r--r--src/gui/panels/history.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/panels/history.c b/src/gui/panels/history.c
index ac33c2c..cfea509 100644
--- a/src/gui/panels/history.c
+++ b/src/gui/panels/history.c
@@ -280,6 +280,7 @@ static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedCo
GList *items; /* Liste des éléments groupés */
GList *i; /* Boucle de parcours #2 */
GDbItem *item; /* Elément à intégrer */
+ char *label; /* Etiquette de représentation */
GtkTreeIter iter; /* Point d'insertion */
if (G_IS_LOADED_BINARY(new))
@@ -335,14 +336,18 @@ static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedCo
{
item = G_DB_ITEM(i->data);
+ label = g_db_item_get_label(item);
+
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
HTC_ITEM, item,
//HTC_PICTURE, G_BOOKMARKS_PANEL_GET_CLASS(panel)->bookmark_img,
HTC_FOREGROUND, g_db_item_is_active(item) ? NULL : "grey",
- HTC_LABEL, g_db_item_get_label(item),
+ HTC_LABEL, label,
-1);
+ free(label);
+
}
g_signal_connect_to_main(collections[k], "content-changed", G_CALLBACK(on_history_changed), panel,
@@ -383,6 +388,7 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem *
GtkListStore *store; /* Modèle de gestion courant */
GtkTreeModel *model; /* Modèle de gestion générique */
GtkTreeSelection *selection; /* Nouvelle sélection à établir*/
+ char *label; /* Etiquette de représentation */
GtkTreeIter iter; /* Boucle de parcours */
builder = G_PANEL_ITEM(panel)->builder;
@@ -428,14 +434,18 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem *
{
case DBA_ADD_ITEM:
+ label = g_db_item_get_label(item);
+
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
HTC_ITEM, item,
//HTC_PICTURE, G_BOOKMARKS_PANEL_GET_CLASS(panel)->bookmark_img,
HTC_FOREGROUND, g_db_item_is_active(item) ? NULL : "grey",
- HTC_LABEL, g_db_item_get_label(item),
+ HTC_LABEL, label,
-1);
+ free(label);
+
break;
case DBA_REM_ITEM: