[gthumb] Do not purge the entire new item list when one new item is duplicated



commit f88f695564c55f7b5fe7598e832fc7f23efdb2ea
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.
    (cherry picked from commit 9c4740422f1be8e9484c07c72e624a2b6a51fe4f)
---
 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 ceb4228..f551bd1 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 f7976b4..aa72965 100644
--- a/libgthumb/gth-sort-utils.c
+++ b/libgthumb/gth-sort-utils.c
@@ -111,6 +111,11 @@ gth_sort_by_filename (const char *name1,
 	int       compare;
 	char     *utf8_name1, *utf8_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]