comparison src/filelist.c @ 510:809bcb660781

Display file_data debug messages only at level 2.
author zas_
date Thu, 24 Apr 2008 09:50:37 +0000
parents 135570a8bd96
children 985fdfebd89e
comparison
equal deleted inserted replaced
509:b78a91d0779e 510:809bcb660781
766 766
767 static FileData *file_data_new(const gchar *path_utf8, struct stat *st, gboolean check_sidecars) 767 static FileData *file_data_new(const gchar *path_utf8, struct stat *st, gboolean check_sidecars)
768 { 768 {
769 FileData *fd; 769 FileData *fd;
770 770
771 DEBUG_1("file_data_new: '%s' %d", path_utf8, check_sidecars); 771 DEBUG_2("file_data_new: '%s' %d", path_utf8, check_sidecars);
772 772
773 if (!file_data_pool) 773 if (!file_data_pool)
774 file_data_pool = g_hash_table_new (g_str_hash, g_str_equal); 774 file_data_pool = g_hash_table_new (g_str_hash, g_str_equal);
775 775
776 fd = g_hash_table_lookup(file_data_pool, path_utf8); 776 fd = g_hash_table_lookup(file_data_pool, path_utf8);
777 if (fd) 777 if (fd)
778 { 778 {
779 file_data_check_changed_files(fd, st); 779 file_data_check_changed_files(fd, st);
780 DEBUG_1("file_data_pool hit: '%s'", fd->path); 780 DEBUG_2("file_data_pool hit: '%s'", fd->path);
781 return file_data_ref(fd); 781 return file_data_ref(fd);
782 } 782 }
783 783
784 fd = g_new0(FileData, 1); 784 fd = g_new0(FileData, 1);
785 785
929 { 929 {
930 if (fd == NULL) return; 930 if (fd == NULL) return;
931 g_assert(fd->magick == 0x12345678); 931 g_assert(fd->magick == 0x12345678);
932 932
933 fd->ref--; 933 fd->ref--;
934 DEBUG_1("file_data_unref (%d): '%s'", fd->ref, fd->path); 934 DEBUG_2("file_data_unref (%d): '%s'", fd->ref, fd->path);
935 935
936 if (fd->ref == 0) 936 if (fd->ref == 0)
937 { 937 {
938 FileData *parent = fd->parent ? fd->parent : fd; 938 FileData *parent = fd->parent ? fd->parent : fd;
939 939
951 work = work->next; 951 work = work->next;
952 } 952 }
953 953
954 /* none of parent/children is referenced, we can free everything */ 954 /* none of parent/children is referenced, we can free everything */
955 955
956 DEBUG_1("file_data_unref: deleting '%s', parent '%s'", fd->path, parent->path); 956 DEBUG_2("file_data_unref: deleting '%s', parent '%s'", fd->path, parent->path);
957 957
958 work = parent->sidecar_files; 958 work = parent->sidecar_files;
959 while (work) 959 while (work)
960 { 960 {
961 FileData *sfd = work->data; 961 FileData *sfd = work->data;