Skip to content

Commit

Permalink
Images to act on: it doesn't take args anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelienpierre committed Feb 6, 2025
1 parent 44075ad commit 8f5b63a
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/common/act_on.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


// get the list of images to act on during global changes (libs, accels)
GList *dt_act_on_get_images(const gboolean only_visible, const gboolean force, const gboolean ordered)
GList *dt_act_on_get_images()
{
if(dt_selection_get_length(darktable.selection) > 0)
return g_list_copy(dt_selection_get_list(darktable.selection));
Expand Down
2 changes: 1 addition & 1 deletion src/common/act_on.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// get images to act on for globals change (via libs or accels)
// The list needs to be freed by the caller
GList *dt_act_on_get_images(const gboolean only_visible, const gboolean force, const gboolean ordered);
GList *dt_act_on_get_images();

// get only the number of images to act on
int dt_act_on_get_images_nb(const gboolean only_visible, const gboolean force);
Expand Down
4 changes: 2 additions & 2 deletions src/common/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ void dt_image_set_location(const int32_t imgid, const dt_image_geoloc_t *geoloc,
{
GList *imgs = NULL;
if(imgid == -1)
imgs = dt_act_on_get_images(TRUE, TRUE, FALSE);
imgs = dt_act_on_get_images();
else
imgs = g_list_prepend(imgs, GINT_TO_POINTER(imgid));
if(group_on) dt_grouping_add_grouped_images(&imgs);
Expand Down Expand Up @@ -2577,7 +2577,7 @@ void dt_image_synch_xmp(const int selected)
// Hell, let's put a pomodoro timer there and call that a feature: 
// take a mandatory break, go stretch your legs, it's good for you.
// Fucking hell.
GList *imgs = dt_act_on_get_images(FALSE, TRUE, FALSE);
GList *imgs = dt_act_on_get_images();
dt_image_synch_xmps(imgs);
g_list_free(imgs);
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ void dt_metadata_set(const int imgid, const char *key, const char *value, const
{
GList *imgs = NULL;
if(imgid == -1)
imgs = dt_act_on_get_images(TRUE, TRUE, FALSE);
imgs = dt_act_on_get_images();
else
imgs = g_list_prepend(imgs, GINT_TO_POINTER(imgid));
if(imgs)
Expand Down
4 changes: 2 additions & 2 deletions src/common/tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ gboolean dt_tag_attach(const guint tagid, const gint imgid, const gboolean undo_
gboolean res = FALSE;
if(imgid == -1)
{
GList *imgs = dt_act_on_get_images(!group_on, TRUE, FALSE);
GList *imgs = dt_act_on_get_images();
res = dt_tag_attach_images(tagid, imgs, undo_on);
g_list_free(imgs);
}
Expand Down Expand Up @@ -558,7 +558,7 @@ gboolean dt_tag_detach(const guint tagid, const gint imgid, const gboolean undo_
{
GList *imgs = NULL;
if(imgid == -1)
imgs = dt_act_on_get_images(!group_on, TRUE, FALSE);
imgs = dt_act_on_get_images();
else
imgs = g_list_prepend(imgs, GINT_TO_POINTER(imgid));
if(group_on) dt_grouping_add_grouped_images(&imgs);
Expand Down
6 changes: 3 additions & 3 deletions src/control/jobs/control_jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static dt_job_t *dt_control_generic_images_job_create(dt_job_execute_callback ex
}
if(progress_type != PROGRESS_NONE)
dt_control_job_add_progress(job, _(message), progress_type == PROGRESS_CANCELLABLE);
params->index = dt_act_on_get_images(only_visible, TRUE, FALSE);
params->index = dt_act_on_get_images();

dt_control_job_set_params(job, params, dt_control_image_enumerator_cleanup);

Expand Down Expand Up @@ -1490,7 +1490,7 @@ static dt_job_t *_control_gpx_apply_job_create(const gchar *filename, int32_t fi
if(filmid != -1)
dt_control_image_enumerator_job_film_init(params, filmid);
else if(!imgs)
params->index = dt_act_on_get_images(TRUE, TRUE, FALSE);
params->index = dt_act_on_get_images();
else
params->index = imgs;
dt_control_gpx_apply_t *data = params->data;
Expand Down Expand Up @@ -2023,7 +2023,7 @@ static dt_job_t *dt_control_datetime_job_create(const GTimeSpan offset, const ch
if(imgs)
params->index = imgs;
else
params->index = dt_act_on_get_images(TRUE, TRUE, FALSE);
params->index = dt_act_on_get_images();

dt_control_datetime_t *data = params->data;
data->offset = offset;
Expand Down
2 changes: 1 addition & 1 deletion src/dtgtk/thumbtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ static void _event_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointe

dt_thumbtable_t *table = (dt_thumbtable_t *)user_data;

table->drag_list = dt_act_on_get_images(FALSE, TRUE, TRUE);
table->drag_list = dt_act_on_get_images();

#ifdef HAVE_MAP
dt_view_manager_t *vm = darktable.view_manager;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static void _export_button_clicked(GtkWidget *widget, dt_lib_export_t *d)
gchar *icc_filename = dt_conf_get_string(CONFIG_PREFIX "iccprofile");
const dt_iop_color_intent_t icc_intent = dt_conf_get_int(CONFIG_PREFIX "iccintent");

GList *list = dt_act_on_get_images(TRUE, TRUE, TRUE);
GList *list = dt_act_on_get_images();
dt_control_export(list, max_width, max_height, format_index, storage_index, TRUE, export_masks,
style, icc_type, icc_filename, icc_intent, d->metadata_export);

Expand Down
4 changes: 2 additions & 2 deletions src/libs/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static void _update(dt_lib_module_t *self)
dt_lib_cancel_postponed_update(self);
dt_lib_metadata_t *d = (dt_lib_metadata_t *)self->data;

GList *imgs = dt_act_on_get_images(FALSE, FALSE, FALSE);
GList *imgs = dt_act_on_get_images();

// first we want to make sure the list of images to act on has changed
// this is not the case if mouse hover change but still stay in selection for ex.
Expand Down Expand Up @@ -911,7 +911,7 @@ int set_params(dt_lib_module_t *self, const void *params, int size)
if(metadata[i][0] != '\0') _append_kv(&key_value, dt_metadata_get_key(i), metadata[i]);
}

GList *imgs = dt_act_on_get_images(FALSE, TRUE, FALSE);
GList *imgs = dt_act_on_get_images();
dt_metadata_set_list(imgs, key_value, TRUE);

g_list_free(key_value);
Expand Down
8 changes: 4 additions & 4 deletions src/libs/styles.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void _styles_row_activated_callback(GtkTreeView *view, GtkTreePath *path,
gchar *name;
gtk_tree_model_get(model, &iter, DT_STYLES_COL_FULLNAME, &name, -1);

GList *list = dt_act_on_get_images(TRUE, TRUE, FALSE);
GList *list = dt_act_on_get_images();
if(name)
{
dt_styles_apply_to_list(name, list, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->duplicate)));
Expand Down Expand Up @@ -242,7 +242,7 @@ static void apply_clicked(GtkWidget *w, gpointer user_data)

if(style_names == NULL) return;

GList *list = dt_act_on_get_images(TRUE, TRUE, FALSE);
GList *list = dt_act_on_get_images();

if(list) dt_multiple_styles_apply_to_list(style_names, list, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->duplicate)));

Expand All @@ -254,7 +254,7 @@ static void create_clicked(GtkWidget *w, gpointer user_data)
{
dt_lib_styles_t *d = (dt_lib_styles_t *)user_data;

GList *list = dt_act_on_get_images(TRUE, TRUE, FALSE);
GList *list = dt_act_on_get_images();
dt_styles_create_from_list(list);
g_list_free(list);
_gui_styles_update_view(d);
Expand Down Expand Up @@ -700,7 +700,7 @@ static gboolean entry_activated(GtkEntry *entry, gpointer user_data)
const gchar *name = gtk_entry_get_text(d->entry);
if(name)
{
GList *imgs = dt_act_on_get_images(TRUE, TRUE, FALSE);
GList *imgs = dt_act_on_get_images();
dt_styles_apply_to_list(name, imgs, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->duplicate)));
g_list_free(imgs);
}
Expand Down
8 changes: 4 additions & 4 deletions src/libs/tagging.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ int set_params(dt_lib_module_t *self, const void *params, int size)
entry++;
}
g_strfreev(tokens);
GList *imgs = dt_act_on_get_images(FALSE, FALSE, FALSE);
GList *imgs = dt_act_on_get_images();
dt_tag_set_tags(tags, imgs, TRUE, FALSE, TRUE);
g_list_free(imgs);
gboolean change = FALSE;
Expand Down Expand Up @@ -1088,7 +1088,7 @@ static void _detach_selected_tag(GtkTreeView *view, dt_lib_module_t *self)
gtk_tree_model_get(model, &iter, DT_LIB_TAGGING_COL_ID, &tagid, -1);
if(tagid <= 0) return;

GList *imgs = dt_act_on_get_images(FALSE, TRUE, FALSE);
GList *imgs = dt_act_on_get_images();
if(!imgs) return;

GList *affected_images = dt_tag_get_images_from_list(imgs, tagid);
Expand Down Expand Up @@ -3315,7 +3315,7 @@ static void _lib_tagging_tag_redo(dt_action_t *action)

if(d->last_tag)
{
GList *imgs = dt_act_on_get_images(FALSE, TRUE, FALSE);
GList *imgs = dt_act_on_get_images();
const gboolean res = dt_tag_attach_string_list(d->last_tag, imgs, TRUE);
if(res) dt_image_synch_xmps(imgs);
g_list_free(imgs);
Expand All @@ -3335,7 +3335,7 @@ static void _lib_tagging_tag_show(dt_action_t *action)
return; // doesn't work properly with tree treeview
}

d->floating_tag_imgs = dt_act_on_get_images(FALSE, TRUE, FALSE);
d->floating_tag_imgs = dt_act_on_get_images();
gint x, y;
gint px, py, w, h;
GtkWidget *window = dt_ui_main_window(darktable.gui->ui);
Expand Down
2 changes: 1 addition & 1 deletion src/lua/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static int _act_on_cb(lua_State *L)
{
lua_newtable(L);
int table_index = 1;
GList *l = dt_act_on_get_images(FALSE, TRUE, TRUE);
GList *l = dt_act_on_get_images();
for(const GList *image = l; image; image = g_list_next(image))
{
luaA_push(L, dt_lua_image_t, &image->data);
Expand Down
2 changes: 1 addition & 1 deletion src/views/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ static void _view_map_changed_callback_delayed(gpointer user_data)
dt_show_times(&start, "[map] dbscan calculation");

// set the clusters
GList *sel_imgs = dt_act_on_get_images(FALSE, FALSE, FALSE);
GList *sel_imgs = dt_act_on_get_images();
int group = -1;
for(i = 0; i< img_count; i++)
{
Expand Down

0 comments on commit 8f5b63a

Please sign in to comment.