Mercurial > geeqie
diff src/pan-view.c @ 39:64068b1bab89
Thu Apr 14 10:44:00 2005 John Ellis <johne@verizon.net>
* cache.c (cache_sim_data_load): Fix to return CacheData if any data
type exists.
* pan-view.c: Fix slow merging of embedded dates into file list;
includes optimizing pan_cache_sync_date and plugging a memory leak.
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
##### an offical release when making enhancements and translation updates. #####
author | gqview |
---|---|
date | Thu, 14 Apr 2005 14:56:17 +0000 |
parents | 67ba4381497e |
children | dcc04a6a58bf |
line wrap: on
line diff
--- a/src/pan-view.c Thu Apr 14 08:54:29 2005 +0000 +++ b/src/pan-view.c Thu Apr 14 14:56:17 2005 +0000 @@ -546,6 +546,7 @@ return (pw->cache_cl == NULL); } +/* This sync date function is optimized for lists with a common sort */ static void pan_cache_sync_date(PanWindow *pw, GList *list) { GList *haystack; @@ -572,16 +573,13 @@ path = ((FileData *)pc)->path; if (path && strcmp(path, fd->path) == 0) { - GList *tmp; - if (pc->cd && pc->cd->have_date && pc->cd->date >= 0) { fd->date = pc->cd->date; } - tmp = needle; - needle = needle->next; - haystack = g_list_delete_link(haystack, tmp); + haystack = g_list_delete_link(haystack, needle); + needle = NULL; } else { @@ -589,6 +587,8 @@ } } } + + g_list_free(haystack); } /* @@ -1911,17 +1911,18 @@ gint end_year = 0; gint end_month = 0; - pw->cache_list = filelist_sort(pw->cache_list, SORT_TIME, TRUE); - list = pan_window_layout_list(path, SORT_NONE, TRUE); - list = filelist_sort(list, SORT_TIME, TRUE); if (pw->cache_list && SORT_BY_EXIF_DATE) { + pw->cache_list = filelist_sort(pw->cache_list, SORT_NAME, TRUE); + list = filelist_sort(list, SORT_NAME, TRUE); pan_cache_sync_date(pw, list); - list = filelist_sort(list, SORT_TIME, TRUE); } + pw->cache_list = filelist_sort(pw->cache_list, SORT_TIME, TRUE); + list = filelist_sort(list, SORT_TIME, TRUE); + day_max = 0; count = 0; tc = 0; @@ -2132,17 +2133,18 @@ gint x_width; gint y_height; - pw->cache_list = filelist_sort(pw->cache_list, SORT_TIME, TRUE); - list = pan_window_layout_list(path, SORT_NONE, TRUE); - list = filelist_sort(list, SORT_TIME, TRUE); if (pw->cache_list && SORT_BY_EXIF_DATE) { + pw->cache_list = filelist_sort(pw->cache_list, SORT_NAME, TRUE); + list = filelist_sort(list, SORT_NAME, TRUE); pan_cache_sync_date(pw, list); - list = filelist_sort(list, SORT_TIME, TRUE); } + pw->cache_list = filelist_sort(pw->cache_list, SORT_TIME, TRUE); + list = filelist_sort(list, SORT_TIME, TRUE); + *width = PAN_FOLDER_BOX_BORDER * 2; *height = PAN_FOLDER_BOX_BORDER * 2;