diff src/view_file_icon.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 5212d4fed37f
children a33badd85f16
line wrap: on
line diff
--- a/src/view_file_icon.c	Wed Apr 23 13:46:18 2008 +0000
+++ b/src/view_file_icon.c	Wed Apr 23 20:47:19 2008 +0000
@@ -653,7 +653,7 @@
 	uri_text = uri_text_from_filelist(list, &total, (info == TARGET_TEXT_PLAIN));
 	filelist_free(list);
 
-	if (debug) printf(uri_text);
+	DEBUG_1(uri_text);
 
 	gtk_selection_data_set(selection_data, selection_data->target,
 			       8, (guchar *)uri_text, total);
@@ -900,7 +900,7 @@
 		col2 = t;
 		}
 
-	if (debug) printf("table: %d x %d to %d x %d\n", row1, col1, row2, col2);
+	DEBUG_1("table: %d x %d to %d x %d\n", row1, col1, row2, col2);
 
 	for (i = row1; i <= row2; i++)
 		{
@@ -1734,7 +1734,7 @@
 
 	vficon_populate(vfi, TRUE, TRUE);
 
-	if (debug) printf("col tab pop cols=%d rows=%d\n", vfi->columns, vfi->rows);
+	DEBUG_1("col tab pop cols=%d rows=%d\n", vfi->columns, vfi->rows);
 }
 
 static void vficon_sync(ViewFileIcon *vfi)
@@ -2001,7 +2001,7 @@
 	if (!thumb_loader_start(vfi->thumbs_loader, fd->path))
 		{
 		/* set icon to unknown, continue */
-		if (debug) printf("thumb loader start failed %s\n", vfi->thumbs_loader->path);
+		DEBUG_1("thumb loader start failed %s\n", vfi->thumbs_loader->path);
 		vficon_thumb_do(vfi, vfi->thumbs_loader, fd);
 
 		return TRUE;
@@ -2617,7 +2617,7 @@
 			if (ignore_list)
 				{
 				new_row = vficon_maint_find_closest(vfi, row, n, ignore_list);
-				if (debug) printf("row = %d, closest is %d\n", row, new_row);
+				DEBUG_1("row = %d, closest is %d\n", row, new_row);
 				}
 			else
 				{