38#include <glib/gstdio.h>
55#ifdef GDK_WINDOWING_QUARTZ
222#define DT_CRAWLER_FOLDER_CACHE_MAX 32
259 guint64 *mtime = (guint64 *)
g_malloc(
sizeof(guint64));
307 gpointer listed =
NULL;
337 const char *c =
name + len;
338 while((c >
name) && (*c !=
'.')) c--;
353 const char *image_path,
408 "[crawler] `%s' (id: %d) is a newer XMP file.\n", item->
xmp_path,
id);
526 "[crawler] %s: %d images, %d folder listings, %d to report, %.2f s\n",
740 " the destination may be full, offline or read-only."),
774 _(
"ERROR: cannot write %s \nthe destination may be full,"
775 " offline or read-only."), entry.
xmp_path);
802 _(
"ERROR: %s NOT synced new (XMP) \342\206\222 old (DB)"), entry.
image_path);
805 _(
"ERROR: cannot write the database. the destination may be full,"
806 " offline or read-only."),
NULL);
812 _(
"SUCCESS: %s synced new (XMP) \342\206\222 old (DB)"), entry.
image_path);
826 _(
"ERROR: %s NOT synced new (DB) \342\206\222 old (XMP)"), entry.
image_path);
829 _(
"ERROR: cannot write %s \nthe destination may be full, offline or read-only."),
872 _(
"ERROR: %s NOT synced old (XMP) \342\206\222 new (DB)"),
875 _(
"ERROR: cannot write the database."
876 " the destination may be full, offline or read-only."),
NULL);
881 _(
"SUCCESS: %s synced old (XMP) \342\206\222 new (DB)"),
894 _(
"ERROR: %s NOT synced old (DB) \342\206\222 new (XMP)"),
897 _(
"ERROR: cannot write %s \nthe destination may be full,"
898 " offline or read-only."), entry.
xmp_path);
903 _(
"SUCCESS: %s synced old (DB) \342\206\222 new (XMP)"),
913 _(
"EXCEPTION: %s has inconsistent timestamps"),
1017 char timestamp_db[64], timestamp_xmp[64];
1019 strftime(timestamp_db,
sizeof(timestamp_db),
1021 strftime(timestamp_xmp,
sizeof(timestamp_xmp),
1098#ifdef GDK_WINDOWING_QUARTZ
GtkWidget * dt_gui_main_window(void)
static void error(char *msg)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
void dt_image_path_append_version_no_db(int version, char *pathname, size_t pathname_len)
dt_image_write_sidecar_result_t dt_image_write_sidecar_file_forced(const int32_t imgid)
struct dt_control_t * dt_control_get_global(void)
void dt_control_crawler_show_image_list(GList *images)
void _overwrite_button_clicked(GtkButton *button, gpointer user_data)
static void sync_db_to_xmp(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
static void _free_crawler_results(GList *results)
dt_control_crawler_cols_t
@ DT_CONTROL_CRAWLER_COL_XMP_PATH
@ DT_CONTROL_CRAWLER_COL_TS_XMP
@ DT_CONTROL_CRAWLER_COL_TS_DB_INT
@ DT_CONTROL_CRAWLER_NUM_COLS
@ DT_CONTROL_CRAWLER_COL_REPORT
@ DT_CONTROL_CRAWLER_COL_IMAGE_PATH
@ DT_CONTROL_CRAWLER_COL_TIME_DELTA
@ DT_CONTROL_CRAWLER_COL_TS_DB
@ DT_CONTROL_CRAWLER_COL_ID
@ DT_CONTROL_CRAWLER_COL_TS_XMP_INT
static void _append_row_to_remove(GtkTreeModel *model, GtkTreePath *path, GList **rowref_list)
static void _select_invert_callback(GtkButton *button, gpointer user_data)
static void _log_synchronization(dt_control_crawler_gui_t *gui, gchar *pattern, gchar *filepath)
static GList * _crawler_run(dt_job_t *job)
static gboolean _crawler_show_results(gpointer user_data)
static gchar * _folded_key(const char *name)
static void _oldest_button_clicked(GtkButton *button, gpointer user_data)
static gboolean _crawl_image(const int32_t id, const int64_t timestamp, const int version, const char *image_path, const int flags, void *user_data)
static void _free_crawler_result(dt_control_crawler_result_t *entry)
static void _free_folder(gpointer p)
static gchar * str_time_delta(const int time_delta)
#define DT_CRAWLER_FOLDER_CACHE_MAX
static void sync_oldest_to_newest(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
void dt_control_crawler_run_in_background(void)
static gboolean _folder_holds(dt_crawler_folder_t *folder, const char *name, time_t *mtime)
static void _set_modification_time(char *filename, const time_t timestamp)
static void _reload_button_clicked(GtkButton *button, gpointer user_data)
static gchar * _sibling_name(const char *name, const char *ext)
static dt_crawler_folder_t * _crawler_folder(dt_crawler_walk_t *walk, const char *dirname)
static void _select_all_callback(GtkButton *button, gpointer user_data)
static void sync_xmp_to_db(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
static void _newest_button_clicked(GtkButton *button, gpointer user_data)
GList * dt_control_crawler_run(void)
static void _delete_selected_rows(dt_control_crawler_gui_t *gui)
static gboolean _job_cancelled(dt_job_t *job)
static void _get_crawler_entry_from_model(GtkTreeModel *model, GtkTreeIter *iter, dt_control_crawler_result_t *entry)
static void dt_control_crawler_response_callback(GtkWidget *dialog, const gint response_id, gpointer user_data)
static int32_t _crawler_job_run(dt_job_t *job)
static void _select_none_callback(GtkButton *button, gpointer user_data)
static void sync_newest_to_oldest(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
GtkTreeStore * store
its model, owned by the view
GtkWidget * folder
destination folder chooser
int dt_history_load_and_apply_on_image(int32_t imgid, gchar *filename, int history_only)
dt_image_write_sidecar_result_t
@ DT_IMAGE_WRITE_SIDECAR_OK
dt_image_t * dt_image_cache_get_existing(const int32_t imgid, char mode)
void dt_image_cache_write_release(dt_image_t *img, dt_image_cache_write_mode_t mode)
gboolean dt_image_repository_set_flags_masked(const int32_t imgid, const int mask, const int value)
Write only mask's bits of imgid's flags, taking them from value.
gboolean dt_image_repository_set_write_timestamp(const int32_t imgid, const int64_t timestamp)
Set write_timestamp of imgid to timestamp (seconds since the epoch). Bound as a 64-bit integer; the c...
void dt_image_repository_foreach_with_path(dt_image_repository_path_row_cb cb, void *user_data)
Walk every image in the library, film roll by film roll, filename within each.
Reading and writing one dt_image_t to and from the library database. The SQL half of what used to be ...
dt_job_state_t dt_control_job_get_state(_dt_job_t *job)
dt_job_t * dt_control_job_create(dt_job_execute_callback execute, const char *msg,...)
int dt_control_add_job(dt_control_t *control, dt_job_queue_t queue_id, _dt_job_t *job)
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
#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.
dt_mipmap_buffer_dsc_flags flags
void dt_osx_disallow_fullscreen(GtkWidget *widget)
#define DT_PATH_MAX
Buffer size for a filesystem path anywhere in Ansel.
static const dt_aligned_pixel_simd_t value
typedef double((*spd)(unsigned long int wavelength, double TempK))