diff options
Diffstat (limited to 'src/job-manager.c')
| -rw-r--r-- | src/job-manager.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/job-manager.c b/src/job-manager.c index 453bb19..5dd5f8c 100644 --- a/src/job-manager.c +++ b/src/job-manager.c @@ -51,6 +51,7 @@ typedef struct { gboolean gen_done; int index; /* processed image index */ int real_index; /* absolute index in the list */ + gboolean gen_portrait; } TJobItem; @@ -138,7 +139,7 @@ thread_func (gpointer data) /* actually do some work */ if (item != NULL && job_item != NULL) { imgname = g_path_get_basename ((item->path == NULL && item->preview) ? item->preview : item->path); - updated = generate_image (job->setup, job->items, item, job_item->real_index, job->dst_dir, ! job->force_update); + updated = generate_image (job->setup, job->items, item, job_item->real_index, job->dst_dir, ! job->force_update, &job_item->gen_portrait); if (updated && job->setup->verbose) { G_LOCK (items_print); @@ -198,6 +199,7 @@ build_tree (TGallerySetup *setup, gboolean force_update; TJobItem *job_item; GList *job_items; + GList *l; printf ("Processing directory \"%s\"\n", src_tree); stats_dirs_inc (); @@ -319,6 +321,7 @@ build_tree (TGallerySetup *setup, job_item->gen_done = FALSE; job_item->index = job->total_items; job_item->real_index = i; + job_item->gen_portrait = FALSE; job_items = g_list_append (job_items, job_item); } } @@ -342,7 +345,6 @@ build_tree (TGallerySetup *setup, } /* wait for threads are finished */ - GList *l; for (l = thread_list; l != NULL; l = l->next) { g_thread_join (l->data); } @@ -354,6 +356,12 @@ build_tree (TGallerySetup *setup, #endif g_free (job); + /* Copy runtime flags back to items, outside of threading */ + for (l = job_items; l != NULL; l = l->next) { + job_item = l->data; + job_item->item->gen_portrait = job_item->gen_portrait; + } + /* Cleanup generator objects */ g_list_foreach (job_items, (GFunc) g_free, NULL); g_list_free (job_items); |
