[gthumb: 34/40] set a lower priority for thumbnail loading



commit 246f3d9751c28532d7bdfcb27d117bef1cffcfe1
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Sep 9 23:27:24 2010 +0200

    set a lower priority for thumbnail loading

 extensions/image_print/gth-load-image-info-task.c |    1 +
 extensions/webalbums/gth-web-exporter.c           |    1 +
 gthumb/gth-image-loader.c                         |    3 ++-
 gthumb/gth-image-loader.h                         |    1 +
 gthumb/gth-image-preloader.c                      |    1 +
 gthumb/gth-overwrite-dialog.c                     |    2 ++
 gthumb/gth-thumb-loader.c                         |    3 +++
 7 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/extensions/image_print/gth-load-image-info-task.c b/extensions/image_print/gth-load-image-info-task.c
index fbf7dc5..80518d3 100644
--- a/extensions/image_print/gth-load-image-info-task.c
+++ b/extensions/image_print/gth-load-image-info-task.c
@@ -162,6 +162,7 @@ load_current_image (GthLoadImageInfoTask *self)
 		gth_image_loader_load (self->priv->loader,
 				       image_info->file_data,
 				       -1,
+				       G_PRIORITY_DEFAULT,
 				       gth_task_get_cancellable (GTH_TASK (self)),
 				       image_loader_ready_cb,
 				       self);
diff --git a/extensions/webalbums/gth-web-exporter.c b/extensions/webalbums/gth-web-exporter.c
index d1eb060..3ef5e3c 100644
--- a/extensions/webalbums/gth-web-exporter.c
+++ b/extensions/webalbums/gth-web-exporter.c
@@ -2739,6 +2739,7 @@ load_current_file (GthWebExporter *self)
 	gth_image_loader_load (self->priv->iloader,
 			       file_data,
 			       -1,
+			       G_PRIORITY_DEFAULT,
 			       gth_task_get_cancellable (GTH_TASK (self)),
 			       image_loader_ready_cb,
 			       self);
diff --git a/gthumb/gth-image-loader.c b/gthumb/gth-image-loader.c
index 8dbf562..0757e05 100644
--- a/gthumb/gth-image-loader.c
+++ b/gthumb/gth-image-loader.c
@@ -228,6 +228,7 @@ void
 gth_image_loader_load (GthImageLoader      *loader,
 		       GthFileData         *file_data,
 		       int                  requested_size,
+		       int                  io_priority,
 		       GCancellable        *cancellable,
 		       GAsyncReadyCallback  callback,
 		       gpointer             user_data)
@@ -240,7 +241,7 @@ gth_image_loader_load (GthImageLoader      *loader,
 						   (GDestroyNotify) load_data_unref);
 	g_simple_async_result_run_in_thread (result,
 					     load_pixbuf_thread,
-					     G_PRIORITY_DEFAULT,
+					     io_priority,
 					     cancellable);
 	g_object_unref (result);
 }
diff --git a/gthumb/gth-image-loader.h b/gthumb/gth-image-loader.h
index e469177..25d65d0 100644
--- a/gthumb/gth-image-loader.h
+++ b/gthumb/gth-image-loader.h
@@ -58,6 +58,7 @@ void              gth_image_loader_set_loader_func        (GthImageLoader
 void              gth_image_loader_load                   (GthImageLoader       *loader,
 							   GthFileData          *file_data,
 							   int                   requested_size,
+							   int                   io_priority,
 							   GCancellable         *cancellable,
 							   GAsyncReadyCallback   callback,
 							   gpointer              user_data);
diff --git a/gthumb/gth-image-preloader.c b/gthumb/gth-image-preloader.c
index db28b81..5b81305 100644
--- a/gthumb/gth-image-preloader.c
+++ b/gthumb/gth-image-preloader.c
@@ -488,6 +488,7 @@ start_next_loader (GthImagePreloader *self)
 		gth_image_loader_load (preloader->loader,
 				       preloader->file_data,
 				       preloader->requested_size,
+				       G_PRIORITY_DEFAULT,
 				       preloader->self->priv->cancellable,
 				       image_loader_ready_cb,
 				       load_request);
diff --git a/gthumb/gth-overwrite-dialog.c b/gthumb/gth-overwrite-dialog.c
index cc50d3f..179deb8 100644
--- a/gthumb/gth-overwrite-dialog.c
+++ b/gthumb/gth-overwrite-dialog.c
@@ -195,6 +195,7 @@ info_ready_cb (GList    *files,
 		gth_image_loader_load (GTH_IMAGE_LOADER (self->priv->new_image_loader),
 				       self->priv->source_data,
 				       PREVIEW_SIZE,
+				       G_PRIORITY_DEFAULT,
 				       NULL, /* FIXME: make this cancellable */
 				       image_loader_ready_cb,
 				       self);
@@ -238,6 +239,7 @@ info_ready_cb (GList    *files,
 	gth_image_loader_load (GTH_IMAGE_LOADER (self->priv->old_image_loader),
 			       self->priv->destination_data,
 			       PREVIEW_SIZE,
+			       G_PRIORITY_DEFAULT,
 			       NULL, /* FIXME: make this cancellable */
 			       image_loader_ready_cb,
 			       self);
diff --git a/gthumb/gth-thumb-loader.c b/gthumb/gth-thumb-loader.c
index 39150bc..001e3aa 100644
--- a/gthumb/gth-thumb-loader.c
+++ b/gthumb/gth-thumb-loader.c
@@ -401,6 +401,7 @@ cache_image_ready_cb (GObject      *source_object,
 		gth_image_loader_load (self->priv->tloader,
 				       load_data->file_data,
 				       load_data->requested_size,
+				       G_PRIORITY_LOW,
 				       load_data->cancellable,
 				       original_image_ready_cb,
 				       load_data);
@@ -804,6 +805,7 @@ gth_thumb_loader_load (GthThumbLoader      *self,
 		gth_image_loader_load (self->priv->iloader,
 				       cache_file_data,
 				       -1,
+				       G_PRIORITY_LOW,
 				       load_data->cancellable,
 				       cache_image_ready_cb,
 				       load_data);
@@ -816,6 +818,7 @@ gth_thumb_loader_load (GthThumbLoader      *self,
 		gth_image_loader_load (self->priv->tloader,
 				       file_data,
 				       self->priv->requested_size,
+				       G_PRIORITY_LOW,
 				       load_data->cancellable,
 				       original_image_ready_cb,
 				       load_data);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]