changeset 1498:5f49f305a6b6

improved debug messages
author nadvornik
date Tue, 31 Mar 2009 20:05:16 +0000
parents 2c54f3f71634
children 56b534d71872
files src/bar_comment.c src/bar_exif.c src/bar_histogram.c src/bar_keywords.c src/cache_maint.c src/collect-io.c src/collect.c src/dupe.c src/filecache.c src/filedata.c src/histogram.c src/image-load.c src/image-overlay.c src/image.c src/img-view.c src/layout_image.c src/search.c src/thumb.c src/view_dir.c src/view_file.c
diffstat 20 files changed, 50 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/bar_comment.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/bar_comment.c	Tue Mar 31 20:05:16 2009 +0000
@@ -162,7 +162,12 @@
 static void bar_pane_comment_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
 	PaneCommentData *pcd = data;
-	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pcd->fd) bar_pane_comment_update(pcd);
+	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pcd->fd) 
+		{
+		DEBUG_1("Notify pane_comment: %s %04x", fd->path, type);
+
+		bar_pane_comment_update(pcd);
+		}
 }
 
 static void bar_pane_comment_changed(GtkTextBuffer *buffer, gpointer data)
--- a/src/bar_exif.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/bar_exif.c	Tue Mar 31 20:05:16 2009 +0000
@@ -314,7 +314,11 @@
 static void bar_pane_exif_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
 	PaneExifData *ped = data;
-	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == ped->fd) bar_pane_exif_update(ped);
+	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == ped->fd) 
+		{
+		DEBUG_1("Notify pane_exif: %s %04x", fd->path, type);
+		bar_pane_exif_update(ped);
+		}
 }
 
 
--- a/src/bar_histogram.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/bar_histogram.c	Tue Mar 31 20:05:16 2009 +0000
@@ -130,7 +130,11 @@
 static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
 	PaneHistogramData *phd = data;
-	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd) bar_pane_histogram_update(phd);
+	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd) 
+		{
+		DEBUG_1("Notify pane_histogram: %s %04x", fd->path, type);
+		bar_pane_histogram_update(phd);
+		}
 }
 
 static gboolean bar_pane_histogram_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
--- a/src/bar_keywords.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/bar_keywords.c	Tue Mar 31 20:05:16 2009 +0000
@@ -411,7 +411,11 @@
 static void bar_pane_keywords_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
 	PaneKeywordsData *pkd = data;
-	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pkd->fd) bar_pane_keywords_update(pkd);
+	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == pkd->fd) 
+		{
+		DEBUG_1("Notify pane_keywords: %s %04x", fd->path, type);
+		bar_pane_keywords_update(pkd);
+		}
 }
 
 static gboolean bar_pane_keywords_changed_idle_cb(gpointer data)
--- a/src/cache_maint.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/cache_maint.c	Tue Mar 31 20:05:16 2009 +0000
@@ -623,6 +623,7 @@
 {
 	if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 	
+	DEBUG_1("Notify cache_maint: %s %04x", fd->path, type);
 	switch (fd->change->type)
 		{
 		case FILEDATA_CHANGE_MOVE:
--- a/src/collect-io.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/collect-io.c	Tue Mar 31 20:05:16 2009 +0000
@@ -936,6 +936,7 @@
 {
 	if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 	
+	DEBUG_1("Notify collect_manager: %s %04x", fd->path, type);
 	switch (fd->change->type)
 		{
 		case FILEDATA_CHANGE_MOVE:
--- a/src/collect.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/collect.c	Tue Mar 31 20:05:16 2009 +0000
@@ -750,6 +750,8 @@
 	CollectionData *cd = data;
 
 	if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+	DEBUG_1("Notify collection: %s %04x", fd->path, type);
 	
 	switch (fd->change->type)
 		{
--- a/src/dupe.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/dupe.c	Tue Mar 31 20:05:16 2009 +0000
@@ -3572,6 +3572,8 @@
 	DupeWindow *dw = data;
 
 	if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+	DEBUG_1("Notify dupe: %s %04x", fd->path, type);
 	
 	switch (fd->change->type)
 		{
--- a/src/filecache.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/filecache.c	Tue Mar 31 20:05:16 2009 +0000
@@ -60,10 +60,10 @@
 		if (fce->fd == fd)
 			{
 			/* entry exists */
-			DEBUG_1("cache hit: fc=%p %s", fc, fd->path);
+			DEBUG_2("cache hit: fc=%p %s", fc, fd->path);
 			if (work == fc->list) return TRUE; /* already at the beginning */
 			/* move it to the beginning */
-			DEBUG_1("cache move to front: fc=%p %s", fc, fd->path);
+			DEBUG_2("cache move to front: fc=%p %s", fc, fd->path);
 			fc->list = g_list_remove_link(fc->list, work);
 			fc->list = g_list_concat(work, fc->list);
 			
@@ -75,7 +75,7 @@
 			}
 		work = work->next;
 		}
-	DEBUG_1("cache miss: fc=%p %s", fc, fd->path);
+	DEBUG_2("cache miss: fc=%p %s", fc, fd->path);
 	return FALSE;
 }
 
@@ -95,7 +95,7 @@
 		fc->list = g_list_delete_link(fc->list, work);
 		work = prev;
 		
-		DEBUG_1("file changed - cache remove: fc=%p %s", fc, last_fe->fd->path);
+		DEBUG_2("file changed - cache remove: fc=%p %s", fc, last_fe->fd->path);
 		fc->size -= last_fe->size;
 		fc->release(last_fe->fd);
 		file_data_unref(last_fe->fd);
@@ -109,7 +109,7 @@
 
 	if (file_cache_get(fc, fd)) return;
 	
-	DEBUG_1("cache add: fc=%p %s", fc, fd->path);
+	DEBUG_2("cache add: fc=%p %s", fc, fd->path);
 	fe = g_new(FileCacheEntry, 1);
 	fe->fd = file_data_ref(fd);
 	fe->size = size;
@@ -183,6 +183,7 @@
 
 	if (type & (NOTIFY_REREAD | NOTIFY_CHANGE)) /* invalidate the entry on each file change */
 		{
+		DEBUG_1("Notify cache: %s %04x", fd->path, type);
 		file_cache_remove_fd(fc, fd);
 		}
 }
--- a/src/filedata.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/filedata.c	Tue Mar 31 20:05:16 2009 +0000
@@ -2281,7 +2281,7 @@
 	nd->priority = priority;
 
 	notify_func_list = g_list_insert_sorted(notify_func_list, nd, file_data_notify_sort);
-	DEBUG_1("Notify func registered: %p", nd);
+	DEBUG_2("Notify func registered: %p", nd);
 	
 	return TRUE;
 }
@@ -2298,7 +2298,7 @@
 			{
 			notify_func_list = g_list_delete_link(notify_func_list, work);
 			g_free(nd);
-			DEBUG_1("Notify func unregistered: %p", nd);
+			DEBUG_2("Notify func unregistered: %p", nd);
 			return TRUE;
 			}
 		work = work->next;
@@ -2316,7 +2316,6 @@
 		{
 		NotifyData *nd = (NotifyData *)work->data;
 		
-		DEBUG_1("Notify func calling: %p %s", nd, fd->path);
 		nd->func(fd, type, nd->data);
 		work = work->next;
 		}
--- a/src/histogram.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/histogram.c	Tue Mar 31 20:05:16 2009 +0000
@@ -383,6 +383,7 @@
 {
 	if ((type & (NOTIFY_CHANGE | NOTIFY_REREAD)) && fd->histmap)
 		{
+		DEBUG_1("Notify histogram: %s %04x", fd->path, type);
 		histmap_free(fd->histmap);
 		fd->histmap = NULL;
 		}
--- a/src/image-load.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/image-load.c	Tue Mar 31 20:05:16 2009 +0000
@@ -163,7 +163,7 @@
 
 	while (g_source_remove_by_user_data(il)) 
 		{
-		DEBUG_1("pending signals detected");
+		DEBUG_2("pending signals detected");
 		}
 	
 	while (il->area_param_list) 
--- a/src/image-overlay.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/image-overlay.c	Tue Mar 31 20:05:16 2009 +0000
@@ -970,6 +970,7 @@
 
 	if ((type & (NOTIFY_HISTMAP)) && osd->imd && fd == osd->imd->image_fd)
 		{
+		DEBUG_1("Notify osd: %s %04x", fd->path, type);
 		osd->notify |= type;
 		image_osd_update_schedule(osd, FALSE);
 		}
--- a/src/image.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/image.c	Tue Mar 31 20:05:16 2009 +0000
@@ -528,7 +528,7 @@
 		image_change_pixbuf(imd, imd->image_fd->pixbuf, image_zoom_get(imd), FALSE);
 		}
 	
-	file_cache_dump(image_get_cache());
+//	file_cache_dump(image_get_cache());
 	return success;
 }
 
@@ -1394,6 +1394,7 @@
 
 	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE)) && fd == imd->image_fd)
 		{
+		DEBUG_1("Notify image: %s %04x", fd->path, type);
 		image_reload(imd);
 		}
 }
--- a/src/img-view.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/img-view.c	Tue Mar 31 20:05:16 2009 +0000
@@ -1704,6 +1704,8 @@
 
 	if (!(type & NOTIFY_CHANGE) || !fd->change) return;
 	
+	DEBUG_1("Notify view_window: %s %04x", fd->path, type);
+
 	switch (fd->change->type)
 		{
 		case FILEDATA_CHANGE_MOVE:
--- a/src/layout_image.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/layout_image.c	Tue Mar 31 20:05:16 2009 +0000
@@ -1894,6 +1894,8 @@
 	LayoutWindow *lw = data;
 
 	if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+	DEBUG_1("Notify layout_image: %s %04x", fd->path, type);
 	
 	switch (fd->change->type)
 		{
--- a/src/search.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/search.c	Tue Mar 31 20:05:16 2009 +0000
@@ -2946,6 +2946,8 @@
 	SearchData *sd = data;
 
 	if (!(type & NOTIFY_CHANGE) || !fd->change) return;
+
+	DEBUG_1("Notify search: %s %04x", fd->path, type);
 	
 	switch (fd->change->type)
 		{
--- a/src/thumb.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/thumb.c	Tue Mar 31 20:05:16 2009 +0000
@@ -536,6 +536,7 @@
 {
 	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE)) && fd->thumb_pixbuf)
 		{
+		DEBUG_1("Notify thumb: %s %04x", fd->path, type);
 		g_object_unref(fd->thumb_pixbuf);
 		fd->thumb_pixbuf = NULL;
 		}
--- a/src/view_dir.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/view_dir.c	Tue Mar 31 20:05:16 2009 +0000
@@ -1027,6 +1027,8 @@
 
 	if (!S_ISDIR(fd->mode)) return; /* this gives correct results even on recently deleted files/directories */
 
+	DEBUG_1("Notify vd: %s %04x", fd->path, type);
+
 	base = remove_level_from_path(fd->path);
 
 	if (vd->type == DIRVIEW_LIST)
--- a/src/view_file.c	Tue Mar 31 19:34:39 2009 +0000
+++ b/src/view_file.c	Tue Mar 31 20:05:16 2009 +0000
@@ -872,6 +872,7 @@
 	
 	if (refresh)
 		{
+		DEBUG_1("Notify vf: %s %04x", fd->path, type);
 		vf_refresh_idle(vf);
 		}
 }