![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <glib.h>
Include dependency graph for folder_survey.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | DT_FOLDER_SURVEY_STYLES_CONF_KEY "studio_capture/styles" |
| #define | DT_FOLDER_SURVEY_STYLES_SEPARATOR "\x1f" |
Functions | |
| void | dt_folder_survey_init () |
| Initialize the folder survey state from the persisted configuration. | |
| int | dt_folder_survey_start () |
| Validate the persisted configuration and start monitoring. | |
| void | dt_folder_survey_halt () |
| User-requested stop: end monitoring and clear the persisted session marker so the next application start does not propose to resume. | |
| gboolean | dt_folder_survey_is_active () |
| TRUE while the periodic folder scan is running. | |
| gboolean | dt_folder_survey_can_start (const char **message) |
| Check, without any side effect, whether the persisted configuration has everything dt_folder_survey_start() requires to succeed. | |
| gboolean | dt_folder_survey_session_was_active () |
| TRUE when the previous application session quit while monitoring. | |
| char * | dt_folder_survey_destination_preview () |
| Build the expanded destination path of a sample file from the current configuration, for GUI preview purposes. | |
| int | dt_folder_survey_count_new_files () |
| Count files in the surveyed folder that are unknown to the persisted baseline, i.e. files that appeared while the application was closed. | |
| void | dt_folder_survey_absorb_new_files () |
| Record every file currently in the surveyed folder as already handled, so restarting the survey will not import them. | |
| gboolean | dt_folder_survey_propose_resume () |
| Propose to resume an interrupted studio session at application start. | |
| void | dt_folder_survey_stop () |
| Stop new scans before control workers begin shutting down. | |
| void | dt_folder_survey_cleanup () |
| Release folder survey state after control workers have stopped. | |
| #define DT_FOLDER_SURVEY_STYLES_CONF_KEY "studio_capture/styles" |
Conf key holding the ordered list of style names auto-applied to studio captures, separated by DT_FOLDER_SURVEY_STYLES_SEPARATOR. Style names may contain any printable character, so the separator is a control character that cannot appear in a name and stays on one line in the conf file.
Definition at line 19 of file folder_survey.h.
| #define DT_FOLDER_SURVEY_STYLES_SEPARATOR "\x1f" |
Definition at line 20 of file folder_survey.h.
| void dt_folder_survey_absorb_new_files | ( | ) |
Record every file currently in the surveyed folder as already handled, so restarting the survey will not import them.
Definition at line 996 of file folder_survey.c.
References _folder_survey, _folder_survey_collect(), _folder_survey_save_locked(), dt_folder_survey_t::baseline_initialized, dt_conf_get_string(), DT_FOLDER_SURVEY_FILE_DONE, dt_free, dt_free_gpointer(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_folder_survey_t::files, dt_folder_survey_t::initialized, IS_NULL_PTR, dt_folder_survey_t::lock, dt_folder_survey_entry_t::mtime, dt_folder_survey_observation_t::mtime, dt_folder_survey_entry_t::size, dt_folder_survey_observation_t::size, dt_folder_survey_entry_t::state, TRUE, and value.
Referenced by _folder_survey_offer_pending_import().
| gboolean dt_folder_survey_can_start | ( | const char ** | message | ) |
Check, without any side effect, whether the persisted configuration has everything dt_folder_survey_start() requires to succeed.
| message | receives a translated, static explanation when the configuration is incomplete or invalid; left untouched otherwise. Safe to display directly in the GUI (e.g. as a status label or tooltip). |
Definition at line 691 of file folder_survey.c.
References dt_conf_get_bool(), dt_conf_get_string_const(), dt_datetime_entry_to_exif(), DT_DATETIME_LENGTH, dt_folder_survey_destination_preview(), dt_free, dt_util_test_writable_dir(), FALSE, IS_NULL_PTR, and TRUE.
Referenced by _studio_import_update_state(), and dt_folder_survey_start().
| void dt_folder_survey_cleanup | ( | ) |
Release folder survey state after control workers have stopped.
Definition at line 1074 of file folder_survey.c.
References _folder_survey, _folder_survey_save_locked(), dt_folder_survey_stop(), dt_free, dt_pthread_mutex_destroy(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_folder_survey_t::files, dt_folder_survey_t::folder, dt_folder_survey_t::generation, dt_folder_survey_t::initialized, dt_folder_survey_t::lock, and dt_folder_survey_t::state_path.
Referenced by dt_cleanup().
| int dt_folder_survey_count_new_files | ( | ) |
Count files in the surveyed folder that are unknown to the persisted baseline, i.e. files that appeared while the application was closed.
Definition at line 954 of file folder_survey.c.
References _folder_survey, _folder_survey_collect(), dt_folder_survey_t::baseline_initialized, dt_conf_get_string(), DT_FOLDER_SURVEY_FILE_DONE, dt_free, dt_free_gpointer(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_folder_survey_t::files, dt_folder_survey_t::initialized, IS_NULL_PTR, dt_folder_survey_t::lock, dt_folder_survey_entry_t::state, and value.
Referenced by _folder_survey_offer_pending_import().
| char * dt_folder_survey_destination_preview | ( | ) |
Build the expanded destination path of a sample file from the current configuration, for GUI preview purposes.
Definition at line 598 of file folder_survey.c.
References dt_build_filename_from_pattern(), dt_conf_get_bool(), dt_conf_get_string(), dt_control_import_data_free(), dt_datetime_entry_to_exif(), DT_DATETIME_LENGTH, dt_free, dt_image_init(), dt_string_to_datetime(), dt_util_test_writable_dir(), dt_control_import_t::imgs, IS_NULL_PTR, and TRUE.
Referenced by _studio_import_update_preview(), and dt_folder_survey_can_start().
| void dt_folder_survey_halt | ( | ) |
User-requested stop: end monitoring and clear the persisted session marker so the next application start does not propose to resume.
Definition at line 923 of file folder_survey.c.
References _folder_survey, _folder_survey_deactivate(), dt_folder_survey_t::active, darktable, dt_control_log(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), DT_SIGNAL_FOLDER_SURVEY_CHANGED, dt_folder_survey_t::initialized, dt_folder_survey_t::lock, and darktable_t::signals.
Referenced by _studio_import_toggle_callback().
| void dt_folder_survey_init | ( | ) |
Initialize the folder survey state from the persisted configuration.
Monitoring is NOT started: it must be requested with dt_folder_survey_start() or through dt_folder_survey_propose_resume().
Definition at line 767 of file folder_survey.c.
References _folder_survey, _folder_survey_load_locked(), _folder_survey_save_locked(), dt_folder_survey_t::baseline_initialized, dt_conf_get_string(), dt_conf_set_string(), DT_FOLDER_SURVEY_STATE_FILE, dt_free, dt_free_gpointer(), dt_loc_get_user_config_dir(), dt_pthread_mutex_init(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_folder_survey_t::files, dt_folder_survey_t::folder, dt_folder_survey_t::initialized, IS_NULL_PTR, dt_folder_survey_t::lock, PATH_MAX, dt_folder_survey_t::state_path, and TRUE.
Referenced by dt_folder_survey_start(), and dt_init().
| gboolean dt_folder_survey_is_active | ( | ) |
TRUE while the periodic folder scan is running.
Definition at line 939 of file folder_survey.c.
References _folder_survey, dt_folder_survey_t::active, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), FALSE, dt_folder_survey_t::initialized, and dt_folder_survey_t::lock.
Referenced by _studio_import_update_state().
| gboolean dt_folder_survey_propose_resume | ( | ) |
Propose to resume an interrupted studio session at application start.
When the previous session quit while monitoring, ask the user whether to resume; on acceptance, switch to the Studio Capture view, then ask whether files that appeared meanwhile should be imported now (with an optional delete-source-after-verified-copy). Call after the GUI and views are ready.
Definition at line 1038 of file folder_survey.c.
References _folder_survey, _folder_survey_save_locked(), darktable, dt_conf_get_string(), dt_folder_survey_session_was_active(), dt_folder_survey_start(), dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_ui_main_window(), dt_view_manager_switch(), FALSE, darktable_t::gui, dt_folder_survey_t::lock, dt_gui_gtk_t::ui, darktable_t::view_manager, and dt_folder_survey_t::was_active_last_session.
Referenced by dt_init().
| gboolean dt_folder_survey_session_was_active | ( | ) |
TRUE when the previous application session quit while monitoring.
Definition at line 949 of file folder_survey.c.
References _folder_survey, dt_folder_survey_t::initialized, and dt_folder_survey_t::was_active_last_session.
Referenced by dt_folder_survey_propose_resume(), and dt_init().
| int dt_folder_survey_start | ( | ) |
Validate the persisted configuration and start monitoring.
All settings are read from the folder_survey conf keys. Validation failures are reported through dt_control_log().
Definition at line 869 of file folder_survey.c.
References _folder_survey, _folder_survey_offer_pending_import(), _folder_survey_reschedule(), _folder_survey_save_locked(), dt_folder_survey_t::active, dt_folder_survey_t::baseline_initialized, darktable, dt_conf_get_bool(), dt_conf_get_string(), dt_conf_set_string(), dt_control_log(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_folder_survey_can_start(), dt_folder_survey_init(), dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), DT_SIGNAL_FOLDER_SURVEY_CHANGED, FALSE, dt_folder_survey_t::files, dt_folder_survey_t::folder, dt_folder_survey_t::generation, dt_folder_survey_t::initialized, dt_folder_survey_t::lock, darktable_t::signals, and TRUE.
Referenced by _studio_import_toggle_callback(), and dt_folder_survey_propose_resume().
| void dt_folder_survey_stop | ( | ) |
Stop new scans before control workers begin shutting down.
The persisted session marker keeps its current state so an active session can be proposed for resume on the next start.
Definition at line 1093 of file folder_survey.c.
References _folder_survey, _folder_survey_save_locked(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_folder_survey_t::immediate_scan, dt_folder_survey_t::initialized, dt_folder_survey_t::lock, dt_folder_survey_t::shutting_down, dt_folder_survey_t::timer, and TRUE.
Referenced by dt_cleanup(), and dt_folder_survey_cleanup().