gint update_idle_id;
+ gint perform_idle_id;
+
gboolean with_sidecars; /* operate on grouped or single files; TRUE = use file_data_sc_, FALSE = use file_data_ functions */
/* alternative dialog parts */
ud->type = type;
ud->phase = UTILITY_PHASE_START;
ud->update_idle_id = -1;
+ ud->perform_idle_id = -1;
ud->external_command = -1;
return ud;
}
if (!ud) return;
if (ud->update_idle_id != -1) g_source_remove(ud->update_idle_id);
+ if (ud->perform_idle_id != -1) g_source_remove(ud->perform_idle_id);
file_data_unref(ud->dir_fd);
filelist_free(ud->content_list);
}
-static void file_util_perform_ci_internal(UtilityData *ud);
+static gboolean file_util_perform_ci_internal(gpointer data);
void file_util_dialog_run(UtilityData *ud);
static gint file_util_perform_ci_cb(gpointer resume_data, gint flags, GList *list, gpointer data);
*/
-static void file_util_perform_ci_internal(UtilityData *ud)
+static gboolean file_util_perform_ci_internal(gpointer data)
{
+ UtilityData *ud = data;
+
+ /* this is removed when ud is destroyed */
+ if (ud->perform_idle_id == -1) ud->perform_idle_id = g_idle_add(file_util_perform_ci_internal, ud);
+
+ g_assert(ud->flist);
- while (ud->flist)
+ if (ud->flist)
{
gint ret;
ret = file_util_perform_ci_cb(GINT_TO_POINTER(!last), status, single_entry, ud);
g_list_free(single_entry);
- if (ret == EDITOR_CB_SUSPEND || last) return;
+ if (ret == EDITOR_CB_SUSPEND || last) return FALSE;
if (ret == EDITOR_CB_SKIP)
{
file_util_perform_ci_cb(NULL, EDITOR_ERROR_SKIPPED, ud->flist, ud);
+ return FALSE;
}
-
- /* FIXME: convert the loop to idle call */
-
}
+
+ return TRUE;
}
static void file_util_perform_ci_dir(UtilityData *ud, gboolean internal, gboolean ext_result)