![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <glib.h>#include "common/paths.h"#include <gio/gio.h>#include <gtk/gtk.h>#include <glib/gstdio.h>#include <stdio.h>#include <string.h>#include "common/logging.h"#include "common/history_actions.h"#include "system/macros.h"#include "system/mem_alloc.h"#include "caches/image_cache.h"#include "control/control.h"#include "control/jobs.h"#include "database/image_repository.h"#include "common/image.h"#include "crawler.h"#include "gui/application.h"#include "widgets/widget_settings.h"#include "widgets/widget_style.h"
Include dependency graph for crawler.c:Go to the source code of this file.
Data Structures | |
| struct | dt_control_crawler_result_t |
| struct | dt_crawler_folder_t |
| struct | dt_crawler_walk_t |
| struct | dt_control_crawler_gui_t |
Macros | |
| #define | DT_CRAWLER_FOLDER_CACHE_MAX 32 |
Typedefs | |
| typedef enum dt_control_crawler_cols_t | dt_control_crawler_cols_t |
| typedef struct dt_control_crawler_result_t | dt_control_crawler_result_t |
| typedef struct dt_crawler_folder_t | dt_crawler_folder_t |
| typedef struct dt_crawler_walk_t | dt_crawler_walk_t |
| typedef struct dt_control_crawler_gui_t | dt_control_crawler_gui_t |
Functions | |
| static void | _free_crawler_result (dt_control_crawler_result_t *entry) |
| static void | _free_crawler_results (GList *results) |
| static void | _set_modification_time (char *filename, const time_t timestamp) |
| static void | _free_folder (gpointer p) |
| static gchar * | _folded_key (const char *name) |
| static gboolean | _job_cancelled (dt_job_t *job) |
| static dt_crawler_folder_t * | _crawler_folder (dt_crawler_walk_t *walk, const char *dirname) |
| static gboolean | _folder_holds (dt_crawler_folder_t *folder, const char *name, time_t *mtime) |
| static gchar * | _sibling_name (const char *name, const char *ext) |
| 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 GList * | _crawler_run (dt_job_t *job) |
| GList * | dt_control_crawler_run (void) |
| static gboolean | _crawler_show_results (gpointer user_data) |
| static int32_t | _crawler_job_run (dt_job_t *job) |
| void | dt_control_crawler_run_in_background (void) |
| static void | dt_control_crawler_response_callback (GtkWidget *dialog, const gint response_id, gpointer user_data) |
| static void | _delete_selected_rows (dt_control_crawler_gui_t *gui) |
| static void | _select_all_callback (GtkButton *button, gpointer user_data) |
| static void | _select_none_callback (GtkButton *button, gpointer user_data) |
| static void | _select_invert_callback (GtkButton *button, gpointer user_data) |
| static void | _get_crawler_entry_from_model (GtkTreeModel *model, GtkTreeIter *iter, dt_control_crawler_result_t *entry) |
| static void | _append_row_to_remove (GtkTreeModel *model, GtkTreePath *path, GList **rowref_list) |
| static void | _log_synchronization (dt_control_crawler_gui_t *gui, gchar *pattern, gchar *filepath) |
| static void | sync_xmp_to_db (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) |
| static void | sync_db_to_xmp (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) |
| static void | sync_newest_to_oldest (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) |
| static void | sync_oldest_to_newest (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) |
| static void | _reload_button_clicked (GtkButton *button, gpointer user_data) |
| void | _overwrite_button_clicked (GtkButton *button, gpointer user_data) |
| static void | _newest_button_clicked (GtkButton *button, gpointer user_data) |
| static void | _oldest_button_clicked (GtkButton *button, gpointer user_data) |
| static gchar * | str_time_delta (const int time_delta) |
| void | dt_control_crawler_show_image_list (GList *images) |
| typedef enum dt_control_crawler_cols_t dt_control_crawler_cols_t |
| typedef struct dt_control_crawler_gui_t dt_control_crawler_gui_t |
| typedef struct dt_control_crawler_result_t dt_control_crawler_result_t |
| typedef struct dt_crawler_folder_t dt_crawler_folder_t |
| typedef struct dt_crawler_walk_t dt_crawler_walk_t |
|
static |
Definition at line 685 of file crawler.c.
References model.
Referenced by sync_db_to_xmp(), sync_newest_to_oldest(), sync_oldest_to_newest(), and sync_xmp_to_db().
|
static |
Definition at line 350 of file crawler.c.
References _crawler_folder(), _folder_holds(), _job_cancelled(), _sibling_name(), DT_DEBUG_CONTROL, dt_free, dt_image_cache_get_existing(), DT_IMAGE_CACHE_MINIMAL, DT_IMAGE_CACHE_RELAXED, dt_image_cache_write_release(), DT_IMAGE_HAS_TXT, DT_IMAGE_HAS_WAV, dt_image_path_append_version_no_db(), dt_image_repository_set_flags_masked(), DT_PATH_MAX, dt_print(), FALSE, flags, dt_image_t::flags, folder, dt_control_crawler_result_t::id, dt_control_crawler_result_t::image_path, dt_crawler_walk_t::images, IS_NULL_PTR, dt_crawler_walk_t::job, dt_crawler_walk_t::result, dt_control_crawler_result_t::timestamp_db, dt_control_crawler_result_t::timestamp_xmp, TRUE, value, and dt_control_crawler_result_t::xmp_path.
Referenced by _crawler_run().
|
static |
Definition at line 224 of file crawler.c.
References _job_cancelled(), DT_CRAWLER_FOLDER_CACHE_MAX, DT_DEBUG_CONTROL, dt_free_gpointer(), dt_print(), entries, error(), folder, dt_crawler_walk_t::folders, IS_NULL_PTR, dt_crawler_walk_t::job, dt_crawler_walk_t::listings, name, and dt_crawler_folder_t::path.
Referenced by _crawl_image().
|
static |
Definition at line 550 of file crawler.c.
References _crawler_run(), _crawler_show_results(), _free_crawler_results(), _job_cancelled(), and IS_NULL_PTR.
Referenced by dt_control_crawler_run_in_background().
|
static |
Definition at line 485 of file crawler.c.
References _crawl_image(), _free_folder(), _job_cancelled(), double(), DT_DEBUG_CONTROL, dt_free_gpointer(), dt_image_repository_foreach_with_path(), dt_print(), dt_crawler_walk_t::folders, dt_crawler_walk_t::images, dt_crawler_walk_t::listings, and dt_crawler_walk_t::result.
Referenced by _crawler_job_run(), and dt_control_crawler_run().
|
static |
Definition at line 543 of file crawler.c.
References dt_control_crawler_show_image_list().
Referenced by _crawler_job_run().
|
static |
Definition at line 611 of file crawler.c.
References IS_NULL_PTR, dt_control_crawler_gui_t::model, model, and dt_control_crawler_gui_t::rows_to_remove.
Referenced by _newest_button_clicked(), _oldest_button_clicked(), _overwrite_button_clicked(), and _reload_button_clicked().
|
static |
|
static |
Definition at line 294 of file crawler.c.
References _folded_key(), dt_free, dt_free_gpointer(), FALSE, folder, IS_NULL_PTR, key, name, and TRUE.
Referenced by _crawl_image().
|
static |
Definition at line 82 of file crawler.c.
References dt_free, dt_control_crawler_result_t::image_path, and dt_control_crawler_result_t::xmp_path.
Referenced by _free_crawler_results(), dt_control_crawler_show_image_list(), sync_db_to_xmp(), sync_newest_to_oldest(), sync_oldest_to_newest(), and sync_xmp_to_db().
|
static |
Definition at line 89 of file crawler.c.
References _free_crawler_result(), dt_free_gpointer(), and IS_NULL_PTR.
Referenced by _crawler_job_run().
|
static |
Definition at line 176 of file crawler.c.
References dt_free, folder, IS_NULL_PTR, and p.
Referenced by _crawler_run().
|
static |
Definition at line 672 of file crawler.c.
References DT_CONTROL_CRAWLER_COL_ID, DT_CONTROL_CRAWLER_COL_IMAGE_PATH, DT_CONTROL_CRAWLER_COL_TS_DB_INT, DT_CONTROL_CRAWLER_COL_TS_XMP_INT, DT_CONTROL_CRAWLER_COL_XMP_PATH, dt_control_crawler_result_t::id, dt_control_crawler_result_t::image_path, model, dt_control_crawler_result_t::timestamp_db, dt_control_crawler_result_t::timestamp_xmp, and dt_control_crawler_result_t::xmp_path.
Referenced by sync_db_to_xmp(), sync_newest_to_oldest(), sync_oldest_to_newest(), and sync_xmp_to_db().
|
static |
Definition at line 211 of file crawler.c.
References dt_control_job_get_state(), dt_control_running(), DT_JOB_STATE_CANCELLED, and IS_NULL_PTR.
Referenced by _crawl_image(), _crawler_folder(), _crawler_job_run(), and _crawler_run().
|
static |
Definition at line 694 of file crawler.c.
References dt_free, FALSE, IS_NULL_PTR, dt_control_crawler_gui_t::log, and TRUE.
Referenced by sync_db_to_xmp(), sync_newest_to_oldest(), sync_oldest_to_newest(), and sync_xmp_to_db().
|
static |
Definition at line 948 of file crawler.c.
References _delete_selected_rows(), dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_gui_t::spinner, sync_newest_to_oldest(), and dt_control_crawler_gui_t::tree.
Referenced by dt_control_crawler_show_image_list().
|
static |
Definition at line 960 of file crawler.c.
References _delete_selected_rows(), dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_gui_t::spinner, sync_oldest_to_newest(), and dt_control_crawler_gui_t::tree.
Referenced by dt_control_crawler_show_image_list().
| void _overwrite_button_clicked | ( | GtkButton * | button, |
| gpointer | user_data | ||
| ) |
Definition at line 936 of file crawler.c.
References _delete_selected_rows(), dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_gui_t::spinner, sync_db_to_xmp(), and dt_control_crawler_gui_t::tree.
Referenced by dt_control_crawler_show_image_list().
|
static |
Definition at line 924 of file crawler.c.
References _delete_selected_rows(), dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_gui_t::spinner, sync_xmp_to_db(), and dt_control_crawler_gui_t::tree.
Referenced by dt_control_crawler_show_image_list().
|
static |
Definition at line 636 of file crawler.c.
References dt_control_crawler_gui_t::tree.
Referenced by dt_control_crawler_show_image_list().
|
static |
Definition at line 653 of file crawler.c.
References dt_control_crawler_gui_t::model, and dt_control_crawler_gui_t::tree.
Referenced by dt_control_crawler_show_image_list().
|
static |
Definition at line 645 of file crawler.c.
References dt_control_crawler_gui_t::tree.
Referenced by dt_control_crawler_show_image_list().
|
static |
Definition at line 96 of file crawler.c.
Referenced by sync_db_to_xmp(), sync_newest_to_oldest(), and sync_oldest_to_newest().
|
static |
|
static |
Definition at line 600 of file crawler.c.
References dt_free, and dt_control_crawler_gui_t::model.
Referenced by dt_control_crawler_show_image_list().
| GList * dt_control_crawler_run | ( | void | ) |
Definition at line 533 of file crawler.c.
References _crawler_run().
Referenced by crawl_xmp_changes(), test_crawl_corrects_an_entry_the_row_already_agrees_with(), test_crawl_keeps_a_cached_entry_in_step(), test_crawl_reads_a_miscased_name_as_the_filesystem_does(), and test_crawl_waits_for_a_held_entry().
Definition at line 569 of file crawler.c.
References _crawler_job_run(), dt_control_add_job(), dt_control_get_global(), dt_control_job_create(), dt_control_running(), DT_JOB_QUEUE_SYSTEM_BG, and IS_NULL_PTR.
Referenced by dt_init().
| void dt_control_crawler_show_image_list | ( | GList * | images | ) |
Definition at line 989 of file crawler.c.
References _free_crawler_result(), _newest_button_clicked(), _oldest_button_clicked(), _overwrite_button_clicked(), _reload_button_clicked(), _select_all_callback(), _select_invert_callback(), _select_none_callback(), DT_CONTROL_CRAWLER_COL_ID, DT_CONTROL_CRAWLER_COL_IMAGE_PATH, DT_CONTROL_CRAWLER_COL_REPORT, DT_CONTROL_CRAWLER_COL_TIME_DELTA, DT_CONTROL_CRAWLER_COL_TS_DB, DT_CONTROL_CRAWLER_COL_TS_DB_INT, DT_CONTROL_CRAWLER_COL_TS_XMP, DT_CONTROL_CRAWLER_COL_TS_XMP_INT, DT_CONTROL_CRAWLER_COL_XMP_PATH, DT_CONTROL_CRAWLER_NUM_COLS, dt_control_crawler_response_callback(), dt_free, dt_free_gpointer(), dt_gui_add_class(), DT_GUI_BOX_SPACING, dt_gui_main_window(), dt_osx_disallow_fullscreen(), DT_PIXEL_APPLY_DPI, FALSE, dt_control_crawler_result_t::id, dt_control_crawler_result_t::image_path, IS_NULL_PTR, dt_control_crawler_gui_t::log, dt_control_crawler_gui_t::model, dt_control_crawler_gui_t::spinner, store, str_time_delta(), dt_control_crawler_result_t::timestamp_db, dt_control_crawler_result_t::timestamp_xmp, dt_control_crawler_gui_t::tree, TRUE, and dt_control_crawler_result_t::xmp_path.
Referenced by _crawler_show_results(), and crawl_xmp_changes().
|
static |
Definition at line 971 of file crawler.c.
Referenced by dt_control_crawler_show_image_list().
|
static |
Definition at line 753 of file crawler.c.
References _append_row_to_remove(), _free_crawler_result(), _get_crawler_entry_from_model(), _log_synchronization(), _set_modification_time(), dt_image_write_sidecar_file_forced(), DT_IMAGE_WRITE_SIDECAR_OK, dt_control_crawler_result_t::id, dt_control_crawler_result_t::image_path, model, dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_result_t::timestamp_db, and dt_control_crawler_result_t::xmp_path.
Referenced by _overwrite_button_clicked().
|
static |
Definition at line 781 of file crawler.c.
References _append_row_to_remove(), _free_crawler_result(), _get_crawler_entry_from_model(), _log_synchronization(), _set_modification_time(), dt_history_load_and_apply_on_image(), dt_image_repository_set_write_timestamp(), dt_image_write_sidecar_file_forced(), DT_IMAGE_WRITE_SIDECAR_OK, error(), dt_control_crawler_result_t::id, dt_control_crawler_result_t::image_path, model, dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_result_t::timestamp_db, dt_control_crawler_result_t::timestamp_xmp, and dt_control_crawler_result_t::xmp_path.
Referenced by _newest_button_clicked().
|
static |
Definition at line 853 of file crawler.c.
References _append_row_to_remove(), _free_crawler_result(), _get_crawler_entry_from_model(), _log_synchronization(), _set_modification_time(), dt_history_load_and_apply_on_image(), dt_image_repository_set_write_timestamp(), dt_image_write_sidecar_file_forced(), DT_IMAGE_WRITE_SIDECAR_OK, error(), dt_control_crawler_result_t::id, dt_control_crawler_result_t::image_path, model, dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_result_t::timestamp_db, dt_control_crawler_result_t::timestamp_xmp, and dt_control_crawler_result_t::xmp_path.
Referenced by _oldest_button_clicked().
|
static |
Definition at line 722 of file crawler.c.
References _append_row_to_remove(), _free_crawler_result(), _get_crawler_entry_from_model(), _log_synchronization(), dt_history_load_and_apply_on_image(), dt_image_repository_set_write_timestamp(), error(), dt_control_crawler_result_t::id, dt_control_crawler_result_t::image_path, model, dt_control_crawler_gui_t::rows_to_remove, dt_control_crawler_result_t::timestamp_xmp, and dt_control_crawler_result_t::xmp_path.
Referenced by _reload_button_clicked().