[gthumb] Add local_path to file_data, for gvfs mount points



commit 3acc2b822a79d2529d9d3a770f701d6c72c9130c
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Mon May 4 12:34:14 2009 -0400

    Add local_path to file_data, for gvfs mount points
---
 libgthumb/file-data.c |    6 ++++++
 libgthumb/file-data.h |    5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libgthumb/file-data.c b/libgthumb/file-data.c
index 8cd2dfa..add752f 100644
--- a/libgthumb/file-data.c
+++ b/libgthumb/file-data.c
@@ -64,6 +64,10 @@ load_info (FileData *fd)
 	GTimeVal   tv;
 
 	gfile = gfile_new (fd->path);
+
+	g_free (fd->local_path);
+	fd->local_path = g_file_get_path (gfile);
+
 	info = g_file_query_info (gfile, 
 				  G_FILE_ATTRIBUTE_STANDARD_SIZE ","
 				  G_FILE_ATTRIBUTE_TIME_CHANGED ","
@@ -150,6 +154,7 @@ file_data_dup (FileData *source)
 	fd->name = file_name_from_path (fd->path);
         fd->utf8_path = g_strdup (source->utf8_path);
         fd->utf8_name = file_name_from_path (fd->utf8_path);
+	fd->local_path = g_strdup (source->local_path);
 
 	fd->mime_type = get_static_string (source->mime_type);
 	fd->size = source->size;
@@ -179,6 +184,7 @@ file_data_unref (FileData *fd)
 	if (fd->ref == 0) {
 		g_free (fd->path);
 		g_free (fd->utf8_path);
+		g_free (fd->local_path);
 		if (fd->comment_data != NULL)
 			comment_data_free (fd->comment_data);
 		g_free (fd->comment);
diff --git a/libgthumb/file-data.h b/libgthumb/file-data.h
index 5da8f52..8bbcdeb 100644
--- a/libgthumb/file-data.h
+++ b/libgthumb/file-data.h
@@ -34,8 +34,9 @@ typedef struct {
 
 	char               *path;          /* Full path name. */
 	const char         *name;          /* File name only. */
-	char               *utf8_path;
-	const char	   *utf8_name;
+	char               *utf8_path;	   /* Always unescaped UTF8 */
+	const char	   *utf8_name;     /* Always unescaped UTF8 */
+	char		   *local_path;    /* May be a gvfs mount point */
 	const char         *mime_type;
 	goffset             size;
 	time_t              ctime;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]