changeset 1441:2908c28eb593

added notification to the exif pane
author nadvornik
date Sun, 15 Mar 2009 12:20:14 +0000
parents 3265830658cd
children e37cde2857c1
files src/bar_exif.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/bar_exif.c	Sun Mar 15 11:58:46 2009 +0000
+++ b/src/bar_exif.c	Sun Mar 15 12:20:14 2009 +0000
@@ -232,6 +232,12 @@
 	bar_pane_exif_update(ped);
 }
 
+static void bar_pane_exif_notify_cb(FileData *fd, NotifyType type, gpointer data)
+{
+	PaneExifData *ped = data;
+	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == ped->fd) bar_pane_exif_update(ped);
+}
+
 /*
  *-------------------------------------------------------------------
  * dnd
@@ -597,6 +603,7 @@
 {
 	PaneExifData *ped = data;
 
+	file_data_unregister_notify_func(bar_pane_exif_notify_cb, ped);
 	g_object_unref(ped->size_group);
 	file_data_unref(ped->fd);
 	g_free(ped);
@@ -646,6 +653,8 @@
 	bar_pane_exif_dnd_init(ped->widget);
 	g_signal_connect(ped->widget, "button_press_event", G_CALLBACK(bar_pane_exif_menu_cb), ped);
 
+	file_data_register_notify_func(bar_pane_exif_notify_cb, ped, NOTIFY_PRIORITY_LOW);
+
 	if (populate)
 		{
 		bar_pane_exif_add_entry(ped, EXIF_FORMATTED("Camera"), NULL, TRUE);