diff src/bar_exif.c @ 138:71e1ebee420e

replaced gchar* path with FileData *fd
author nadvornik
date Tue, 11 Sep 2007 20:06:29 +0000
parents 50fc73e08550
children 695e1ad3b169
line wrap: on
line diff
--- a/src/bar_exif.c	Thu Aug 23 20:45:59 2007 +0000
+++ b/src/bar_exif.c	Tue Sep 11 20:06:29 2007 +0000
@@ -16,6 +16,7 @@
 #include "exif.h"
 #include "ui_bookmark.h"
 #include "ui_misc.h"
+#include "filelist.h"
 
 #include <math.h>
 
@@ -119,7 +120,7 @@
 	GtkWidget *custom_name[EXIF_BAR_CUSTOM_COUNT];
 	GtkWidget *custom_value[EXIF_BAR_CUSTOM_COUNT];
 
-	gchar *path;
+	FileData *fd;
 
 	gint allow_search;
 };
@@ -171,7 +172,7 @@
 	ExifData *exif;
 	gint len, i;
 
-	exif = exif_read(eb->path, FALSE);
+	exif = exif_read(eb->fd, FALSE);
 
 	if (!exif)
 		{
@@ -310,7 +311,7 @@
 		}
 }
 
-void bar_exif_set(GtkWidget *bar, const gchar *path)
+void bar_exif_set(GtkWidget *bar, FileData *fd)
 {
 	ExifBar *eb;
 
@@ -318,8 +319,8 @@
 	if (!eb) return;
 
 	/* store this, advanced view toggle needs to reload data */
-	g_free(eb->path);
-	eb->path = g_strdup(path);
+	file_data_unref(eb->fd);
+	eb->fd = file_data_ref(fd);
 
 	bar_exif_clear(eb);
 	bar_exif_update(eb);
@@ -520,11 +521,11 @@
 	ExifBar *eb = data;
 
 	g_free(eb->labels);
-	g_free(eb->path);
+	file_data_unref(eb->fd);
 	g_free(eb);
 }
 
-GtkWidget *bar_exif_new(gint show_title, const gchar *path, gint advanced, GtkWidget *bounding_widget)
+GtkWidget *bar_exif_new(gint show_title, FileData *fd, gint advanced, GtkWidget *bounding_widget)
 {
 	ExifBar *eb;
 	GtkWidget *table;
@@ -652,7 +653,7 @@
 		gtk_widget_show(eb->scrolled);
 		}
 
-	eb->path = g_strdup(path);
+	eb->fd = file_data_ref(fd);
 	bar_exif_update(eb);
 
 	return eb->vbox;