61 if(params->film->ref <= 0)
108 params->imagelist = NULL;
135 params->imagelist = NULL;
136 for(
int i = 1;
i < argc;
i++)
139 if(!g_file_test(path, G_FILE_TEST_IS_DIR))
142 params->imagelist = g_list_prepend(params->imagelist, path);
147 GDir *cdir = g_dir_open(path, 0, NULL);
152 const gchar *fname = g_dir_read_name(cdir);
154 if(fname[0] ==
'.')
continue;
155 gchar *fullname = g_build_filename(path, fname, NULL);
157 params->imagelist = g_list_prepend(params->imagelist, fullname);
166 params->imagelist = g_list_reverse(params->imagelist);
175 GDir *cdir = g_dir_open(path, 0, NULL);
184 const gchar *filename = g_dir_read_name(cdir);
188 if(filename[0] ==
'.')
continue;
191 fullname = g_build_filename(path, filename, NULL);
194 if(recursive && g_file_test(fullname, G_FILE_TEST_IS_DIR))
201 *result = g_list_prepend(*result, fullname);
220 g_dir_rewind(cfr->
dir);
221 const gchar *dfn = NULL;
222 while((dfn = g_dir_read_name(cfr->
dir)) != NULL)
225 const size_t len = strlen(dfn);
226 if(strcmp(dfn + len - 4,
".gpx") == 0 || strcmp(dfn + len - 4,
".GPX") == 0)
228 gchar *gpx_file = g_build_path(G_DIR_SEPARATOR_S, cfr->
dirname, dfn, NULL);
243 gchar *a_basename = g_path_get_basename(a);
244 gchar *b_basename = g_path_get_basename(b);
245 const int ret = g_strcmp0(a_basename, b_basename);
261 dt_control_log(_(
"no supported images were found to be imported"));
276 gchar message[512] = { 0 };
278 const guint total = g_list_length(images);
279 g_snprintf(message,
sizeof(message) - 1, ngettext(
"Importing %d image",
"Importing %d images", total), total);
282 GList *all_imgs = NULL;
283 gint64 last_collection_refresh = 0;
295 for(GList *image = images; image; image = g_list_next(image))
297 gchar *cdn = g_path_get_dirname((
const gchar *)image->data);
305 if(cfr && cfr != film)
335 fraction += 1.0 / total;
343 all_imgs = g_list_prepend(all_imgs, GINT_TO_POINTER(imgid));
348 all_imgs = g_list_reverse(all_imgs);
void dt_ui_notify_user()
draw user's attention
void dt_collection_update_query(const dt_collection_t *collection, dt_collection_change_t query_change, dt_collection_properties_t changed_property, GList *list)
dt_collection_t * dt_collection_get_global(void)
void dt_collection_notify_imported(const int32_t imgid, const gchar *known_image_folder, gint64 *last_refresh_us)
void dt_collection_load_filmroll(dt_collection_t *collection, const int32_t imgid, dt_collection_import_view_t view_policy, gboolean set_mouse_over)
@ DT_COLLECTION_PROP_UNDEF
@ DT_COLLECTION_CHANGE_NEW_QUERY
@ DT_COLLECTION_IMPORT_VIEW_GRID
@ DT_COLLECTION_IMPORT_VIEW_IMAGE
int dt_conf_get_bool(const char *name)
gchar * dt_conf_get_string(const char *name)
Read the stored string for name as a private copy.
int32_t dt_image_import(const int32_t film_id, const char *filename, gboolean raise_signals)
void dt_control_set_mouse_over_id(int32_t value)
void dt_control_log(const char *msg,...)
void dt_control_queue_redraw_center()
Request a redraw of the centre view.
void dt_control_gpx_apply(const gchar *filename, int32_t filmid, const gchar *tz, GList *imgs)
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
void dt_film_init(dt_film_t *film)
gboolean dt_film_is_empty(const int id)
int dt_film_new(dt_film_t *film, const char *directory)
void dt_film_remove(const int id)
void dt_film_cleanup(dt_film_t *film)
dt_job_t * dt_pathlist_import_create(int argc, char *argv[])
static void _film_import1(dt_job_t *job, dt_film_t *film, GList *images)
static void _pathlist_import_cleanup(void *p)
static GList * _film_recursive_get_files(const gchar *path, gboolean recursive, GList **result)
static int _film_filename_cmp(gchar *a, gchar *b)
static int32_t dt_film_import1_run(dt_job_t *job)
dt_job_t * dt_film_import1_create(dt_film_t *film)
static int32_t _pathlist_import_run(dt_job_t *job)
static void _apply_filmroll_gpx(dt_film_t *cfr)
static void dt_film_import1_cleanup(void *p)
gboolean dt_supported_image(const gchar *filename)
dt_job_t * dt_control_job_create(dt_job_execute_callback execute, const char *msg,...)
void * dt_control_job_get_params(const _dt_job_t *job)
void dt_control_job_set_progress(dt_job_t *job, double value)
void dt_control_job_add_progress(dt_job_t *job, const char *message, gboolean cancellable)
void dt_control_job_set_progress_message(dt_job_t *job, const char *message)
void dt_control_job_set_params(_dt_job_t *job, void *params, dt_job_destroy_callback callback)
void dt_control_job_dispose(_dt_job_t *job)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static void dt_free_gpointer(gpointer ptr)
g_free() one pointer, with the signature GDestroyNotify wants.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
struct dt_control_signal_t * dt_control_signal_get_global(void)
@ DT_SIGNAL_GEOTAG_CHANGED
This signal is raised when a geotag is added/deleted/changed
dt_pthread_mutex_t images_mutex
gchar * dt_util_normalize_path(const gchar *_input)