[gthumb/gthumb-2-10] Do not purge the entire new item list when one new item is duplicated



commit 9c4740422f1be8e9484c07c72e624a2b6a51fe4f
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Thu Apr 30 14:57:01 2009 -0400

    Do not purge the entire new item list when one new item is duplicated
    
    Also, add a null check to the filename sorting routine.
---
 libgthumb/gth-file-list.c  |    2 +-
 libgthumb/gth-sort-utils.c |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libgthumb/gth-file-list.c b/libgthumb/gth-file-list.c
index 3e331ce..1e308e5 100644
--- a/libgthumb/gth-file-list.c
+++ b/libgthumb/gth-file-list.c
@@ -1168,7 +1168,7 @@ load_new_list (GthFileList *file_list)
 			/* remove the file from new_list */
 			
 			file_list->priv->new_list = g_list_remove_link (file_list->priv->new_list, scan);
-			file_data_list_free (scan);
+			file_data_unref (scan->data);
 		}
 		
 		scan = next;
diff --git a/libgthumb/gth-sort-utils.c b/libgthumb/gth-sort-utils.c
index ee3529b..e60cbcf 100644
--- a/libgthumb/gth-sort-utils.c
+++ b/libgthumb/gth-sort-utils.c
@@ -137,6 +137,11 @@ gth_sort_by_filename_but_ignore_path (const char *name1,
 	int       compare;
 	char     *unesc_name1, *unesc_name2;
 
+        if (name2 == NULL)
+                return 1;
+        if (name1 == NULL)
+                return -1;
+
 	sort_last_1 = file_name_from_path (name1)[0] == SORT_LAST_CHAR1
 			|| file_name_from_path (name1)[0] == SORT_LAST_CHAR2;
 	sort_last_2 = file_name_from_path (name2)[0] == SORT_LAST_CHAR1



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