![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "database/film_repository.h"#include "database/database.h"#include "database/sql_debug.h"#include "system/macros.h"#include "system/mem_alloc.h"
Include dependency graph for film_repository.c:Go to the source code of this file.
Functions | |
| int32_t | dt_film_repository_find_by_folder (const char *folder) |
| char * | dt_film_repository_get_folder (const int32_t id) |
| gboolean | dt_film_repository_insert (const char *folder) |
| gboolean | dt_film_repository_touch_access (const int32_t id) |
| gboolean | dt_film_repository_set_folder (const int32_t id, const char *folder) |
| gboolean | dt_film_repository_delete (const int32_t id) |
| gboolean | dt_film_repository_has_images (const int32_t id) |
| GList * | dt_film_repository_get_image_ids (const int32_t filmid) |
| void | dt_film_repository_foreach (dt_film_repository_row_cb cb, void *user_data) |
| void | dt_film_repository_foreach_empty (dt_film_repository_row_cb cb, void *user_data) |
| void | dt_film_repository_foreach_under (const char *path, dt_film_repository_row_cb cb, void *user_data) |
| void | dt_film_repository_folder_status_clear (void) |
| void | dt_film_repository_folder_status_set (const int32_t id, const gboolean present) |
| gboolean dt_film_repository_delete | ( | const int32_t | id | ) |
delete roll id.
Foreign keys cascade this to every image of the roll and to everything referencing those images, so the caller must have released them from its caches first.
Definition at line 112 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by dt_film_remove(), and dt_film_remove_empty().
| int32_t dt_film_repository_find_by_folder | ( | const char * | folder | ) |
main.film_rolls – one row per imported folder – and the memory.film_folder scratch table that records, for this session, which of those folders still exist on disk.
Deciding what to do about a film roll is common/film.c's: whether an empty one should have its directory removed, whether the user is asked first, what a relocation means. This module answers only what the table says and writes back what it is told. the id of the roll whose folder is folder, or -1.
Matched case-insensitively on Windows and exactly everywhere else, which is why the caller cannot express this as a plain equality itself.
Definition at line 29 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.
Referenced by dt_film_get_id(), and testdb_make_film().
forget every recorded status
Definition at line 203 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by dt_film_set_folder_status().
record whether roll id's folder is currently present
Definition at line 213 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by _record_folder_status(), and dt_film_new().
| void dt_film_repository_foreach | ( | dt_film_repository_row_cb | cb, |
| void * | user_data | ||
| ) |
every roll, in row order
Definition at line 156 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.
Referenced by dt_film_set_folder_status().
| void dt_film_repository_foreach_empty | ( | dt_film_repository_row_cb | cb, |
| void * | user_data | ||
| ) |
every roll that has no images left
Definition at line 169 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.
Referenced by dt_film_remove_empty().
| void dt_film_repository_foreach_under | ( | const char * | path, |
| dt_film_repository_row_cb | cb, | ||
| void * | user_data | ||
| ) |
every roll whose folder is path or below it
Definition at line 186 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.
Referenced by dt_film_relocate().
| char * dt_film_repository_get_folder | ( | const int32_t | id | ) |
the folder of roll id, or NULL. Caller owns it.
Definition at line 48 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by dt_film_new(), dt_film_open(), dt_film_set_query(), dt_image_copy_rename(), dt_image_film_roll(), dt_image_film_roll_directory(), and dt_image_rename().
every image id of roll filmid, in row order
Definition at line 139 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by dt_control_image_enumerator_job_film_init(), dt_film_get_image_ids(), and dt_film_remove().
| gboolean dt_film_repository_has_images | ( | const int32_t | id | ) |
TRUE when roll id has at least one image
Definition at line 126 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, L, and TRUE.
Referenced by dt_film_is_empty().
| gboolean dt_film_repository_insert | ( | const char * | folder | ) |
insert a roll for folder, stamped as accessed now
Definition at line 65 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, IS_NULL_PTR, and L.
Referenced by dt_film_new(), and testdb_make_film().
move roll id to folder
Definition at line 98 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, IS_NULL_PTR, and L.
Referenced by dt_film_relocate().
| gboolean dt_film_repository_touch_access | ( | const int32_t | id | ) |
stamp roll id as accessed now
Definition at line 82 of file film_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by dt_film_open().