[gthumb/ext] use the uri if the id is not available



commit 87a484a5a727ff0c144e63345cb5e57789f27fbc
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Sep 9 11:51:40 2009 +0200

    use the uri if the id is not available

 gthumb/gio-utils.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gio-utils.c b/gthumb/gio-utils.c
index 95e2a1e..384c99b 100644
--- a/gthumb/gio-utils.c
+++ b/gthumb/gio-utils.c
@@ -339,15 +339,20 @@ for_each_child_next_files_ready (GObject      *source_object,
 		file = g_file_get_child (fec->current->file, g_file_info_get_name (child_info));
 
 		if (g_file_info_get_file_type (child_info) == G_FILE_TYPE_DIRECTORY) {
-			const char *id;
+			char *id;
 
 			/* avoid to visit a directory more than ones */
 
-			id = g_file_info_get_attribute_string (child_info, G_FILE_ATTRIBUTE_ID_FILE);
+			id = g_strdup (g_file_info_get_attribute_string (child_info, G_FILE_ATTRIBUTE_ID_FILE));
+			if (id == NULL)
+				id = g_file_get_uri (file);
+
 			if (g_hash_table_lookup (fec->already_visited, id) == NULL) {
 				g_hash_table_insert (fec->already_visited, g_strdup (id), GINT_TO_POINTER (1));
 				fec->to_visit = g_list_append (fec->to_visit, child_data_new (file, child_info));
 			}
+
+			g_free (id);
 		}
 
 		fec->for_each_file_func (file, child_info, fec->user_data);



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