changeset 890:bc9df0fecdc1

Introduce image_loader_set_done_func().
author zas_
date Fri, 18 Jul 2008 09:55:15 +0000
parents cb3b6238782a
children 841b387dd877
files src/image-load.c src/image-load.h src/image.c
diffstat 3 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/image-load.c	Thu Jul 17 22:36:58 2008 +0000
+++ b/src/image-load.c	Fri Jul 18 09:55:15 2008 +0000
@@ -427,6 +427,16 @@
 	il->data_error = data_error;
 }
 
+void image_loader_set_done_func(ImageLoader *il,
+				void (*func_done)(ImageLoader *, gpointer),
+				gpointer data_done)
+{
+	if (!il) return;
+
+	il->func_done = func_done;
+	il->data_done = data_done;
+}
+
 void image_loader_set_percent_func(ImageLoader *il,
 				   void (*func_percent)(ImageLoader *, gdouble, gpointer),
 				   gpointer data_percent)
@@ -465,8 +475,7 @@
 
 	if (!image_loader_path(il)) return FALSE;
 
-	il->func_done = func_done;
-	il->data_done = data_done;
+	image_loader_set_done_func(il, func_done, data_done);
 
 	return image_loader_setup(il);
 }
--- a/src/image-load.h	Thu Jul 17 22:36:58 2008 +0000
+++ b/src/image-load.h	Fri Jul 18 09:55:15 2008 +0000
@@ -27,6 +27,9 @@
 void image_loader_set_error_func(ImageLoader *il,
 				 void (*func_error)(ImageLoader *, gpointer),
 				 gpointer data_error);
+void image_loader_set_done_func(ImageLoader *il,
+				void (*func_done)(ImageLoader *, gpointer),
+				gpointer data_done);
 void image_loader_set_percent_func(ImageLoader *il,
 				   void (*func_percent)(ImageLoader *, gdouble, gpointer),
 				   gpointer data_percent);
--- a/src/image.c	Thu Jul 17 22:36:58 2008 +0000
+++ b/src/image.c	Fri Jul 18 09:55:15 2008 +0000
@@ -621,15 +621,13 @@
 		/* override the old signals */
 		image_loader_set_area_ready_func(imd->il, image_load_area_cb, imd);
 		image_loader_set_error_func(imd->il, image_load_error_cb, imd);
+		image_loader_set_done_func(imd->il, image_load_done_cb, imd);
 		image_loader_set_buffer_size(imd->il, IMAGE_LOAD_BUFFER_COUNT);
 
 #ifdef IMAGE_THROTTLE_LARGER_IMAGES
 		image_load_buffer_throttle(imd->il);
 #endif
 
-		/* do this one directly (probably should add a set func) */
-		imd->il->func_done = image_load_done_cb;
-
 		g_object_set(G_OBJECT(imd->pr), "loading", TRUE, NULL);
 		image_state_set(imd, IMAGE_STATE_LOADING);