diff src/search.c @ 1012:fe82830ab8fd

converted image loader to a GObject and use signals for notification
author nadvornik
date Fri, 29 Aug 2008 20:53:53 +0000
parents 616b14da08c2
children 9962b24b6b43
line wrap: on
line diff
--- a/src/search.c	Fri Aug 29 12:35:13 2008 +0000
+++ b/src/search.c	Fri Aug 29 20:53:53 2008 +0000
@@ -1583,8 +1583,9 @@
 		    (sd->match_similarity_enable && !sd->img_cd->similarity))
 			{
 			sd->img_loader = image_loader_new(fd);
-			image_loader_set_error_func(sd->img_loader, search_file_load_done_cb, sd);
-			if (image_loader_start(sd->img_loader, search_file_load_done_cb, sd))
+			g_signal_connect (G_OBJECT(sd->img_loader), "error", (GCallback)search_file_load_done_cb, sd);
+			g_signal_connect (G_OBJECT(sd->img_loader), "done", (GCallback)search_file_load_done_cb, sd);
+			if (image_loader_start(sd->img_loader))
 				{
 				return TRUE;
 				}
@@ -2063,8 +2064,9 @@
 				}
 
 			sd->img_loader = image_loader_new(file_data_new_simple(sd->search_similarity_path));
-			image_loader_set_error_func(sd->img_loader, search_similarity_load_done_cb, sd);
-			if (image_loader_start(sd->img_loader, search_similarity_load_done_cb, sd))
+			g_signal_connect (G_OBJECT(sd->img_loader), "error", (GCallback)search_similarity_load_done_cb, sd);
+			g_signal_connect (G_OBJECT(sd->img_loader), "done", (GCallback)search_similarity_load_done_cb, sd);
+			if (image_loader_start(sd->img_loader))
 				{
 				return;
 				}