Mercurial > geeqie.yaz
comparison src/filelist.c @ 495:c7a2471e5c4e
Introduce macros to display debug messages.
if (debug) printf(...) is now replaced by variadic macros:
DEBUG_1()
And for higher debugging levels:
DEBUG_2()
DEBUG_3()
DEBUG_4()
author | zas_ |
---|---|
date | Wed, 23 Apr 2008 20:47:19 +0000 |
parents | 48c8e49b571c |
children | fc9c8a3e1a8b |
comparison
equal
deleted
inserted
replaced
494:3bb9a8df6ee9 | 495:c7a2471e5c4e |
---|---|
197 filter = g_string_append(filter, extensions[i]); | 197 filter = g_string_append(filter, extensions[i]); |
198 } | 198 } |
199 i++; | 199 i++; |
200 } | 200 } |
201 | 201 |
202 if (debug) printf("loader reported [%s] [%s] [%s]\n", name, desc, filter->str); | 202 DEBUG_1("loader reported [%s] [%s] [%s]\n", name, desc, filter->str); |
203 | 203 |
204 filter_add_if_missing(name, desc, filter->str, FORMAT_CLASS_IMAGE, TRUE); | 204 filter_add_if_missing(name, desc, filter->str, FORMAT_CLASS_IMAGE, TRUE); |
205 | 205 |
206 g_free(name); | 206 g_free(name); |
207 g_free(desc); | 207 g_free(desc); |
765 | 765 |
766 static FileData *file_data_new(const gchar *path_utf8, struct stat *st, gboolean check_sidecars) | 766 static FileData *file_data_new(const gchar *path_utf8, struct stat *st, gboolean check_sidecars) |
767 { | 767 { |
768 FileData *fd; | 768 FileData *fd; |
769 | 769 |
770 if (debug) printf("file_data_new: '%s' %d\n", path_utf8, check_sidecars); | 770 DEBUG_1("file_data_new: '%s' %d\n", path_utf8, check_sidecars); |
771 | 771 |
772 if (!file_data_pool) | 772 if (!file_data_pool) |
773 file_data_pool = g_hash_table_new (g_str_hash, g_str_equal); | 773 file_data_pool = g_hash_table_new (g_str_hash, g_str_equal); |
774 | 774 |
775 fd = g_hash_table_lookup(file_data_pool, path_utf8); | 775 fd = g_hash_table_lookup(file_data_pool, path_utf8); |
776 if (fd) | 776 if (fd) |
777 { | 777 { |
778 file_data_check_changed_files(fd, st); | 778 file_data_check_changed_files(fd, st); |
779 if (debug) printf("file_data_pool hit: '%s'\n", fd->path); | 779 DEBUG_1("file_data_pool hit: '%s'\n", fd->path); |
780 return file_data_ref(fd); | 780 return file_data_ref(fd); |
781 } | 781 } |
782 | 782 |
783 fd = g_new0(FileData, 1); | 783 fd = g_new0(FileData, 1); |
784 | 784 |
928 { | 928 { |
929 if (fd == NULL) return; | 929 if (fd == NULL) return; |
930 g_assert(fd->magick == 0x12345678); | 930 g_assert(fd->magick == 0x12345678); |
931 | 931 |
932 fd->ref--; | 932 fd->ref--; |
933 if (debug) printf("file_data_unref (%d): '%s'\n", fd->ref, fd->path); | 933 DEBUG_1("file_data_unref (%d): '%s'\n", fd->ref, fd->path); |
934 | 934 |
935 if (fd->ref == 0) | 935 if (fd->ref == 0) |
936 { | 936 { |
937 FileData *parent = fd->parent ? fd->parent : fd; | 937 FileData *parent = fd->parent ? fd->parent : fd; |
938 | 938 |
950 work = work->next; | 950 work = work->next; |
951 } | 951 } |
952 | 952 |
953 /* none of parent/children is referenced, we can free everything */ | 953 /* none of parent/children is referenced, we can free everything */ |
954 | 954 |
955 if (debug) printf("file_data_unref: deleting '%s', parent '%s'\n", fd->path, parent->path); | 955 DEBUG_1("file_data_unref: deleting '%s', parent '%s'\n", fd->path, parent->path); |
956 | 956 |
957 work = parent->sidecar_files; | 957 work = parent->sidecar_files; |
958 while (work) | 958 while (work) |
959 { | 959 { |
960 FileData *sfd = work->data; | 960 FileData *sfd = work->data; |