Updating branch refs/heads/master to cf5824dbf292a0f3fcb2ac0835d281f0f465b202 (commit) from 1ce6812ab6a0ab6708b534f087e5f57e3c9dbf75 (commit)
commit cf5824dbf292a0f3fcb2ac0835d281f0f465b202 Author: Stephan Arts <step...@xfce.org> Date: Sun Apr 15 22:27:19 2012 +0200 Add progressive loading of directories src/image_list.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/src/image_list.c b/src/image_list.c index 8a2cdb0..4d5382c 100644 --- a/src/image_list.c +++ b/src/image_list.c @@ -684,6 +684,32 @@ cb_rstto_read_file ( gpointer user_data ) NULL ); if ( NULL != file_info ) { + /* Allow for 'progressive' loading */ + if (loader->n_files == 100) + { + for (i = 0; i < loader->n_files; ++i) + { + rstto_image_list_add_file ( + loader->image_list, + loader->files[i], + NULL); + + g_object_unref (loader->files[i]); + } + + iter = loader->image_list->priv->iterators; + while (iter) + { + g_signal_emit (G_OBJECT (iter->data), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED], 0, NULL); + iter = g_slist_next (iter); + } + + g_free (loader->files); + loader->files = NULL; + loader->n_files = 0; + } + + /* Add file to the list */ content_type = g_file_info_get_content_type (file_info); if (strncmp (content_type, "image/", 6) == 0) { _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits