Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
crawler.c File Reference
#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
 

Enumerations

enum  dt_control_crawler_cols_t {
  DT_CONTROL_CRAWLER_COL_ID = 0 ,
  DT_CONTROL_CRAWLER_COL_IMAGE_PATH ,
  DT_CONTROL_CRAWLER_COL_XMP_PATH ,
  DT_CONTROL_CRAWLER_COL_TS_XMP ,
  DT_CONTROL_CRAWLER_COL_TS_DB ,
  DT_CONTROL_CRAWLER_COL_TS_XMP_INT ,
  DT_CONTROL_CRAWLER_COL_TS_DB_INT ,
  DT_CONTROL_CRAWLER_COL_REPORT ,
  DT_CONTROL_CRAWLER_COL_TIME_DELTA ,
  DT_CONTROL_CRAWLER_NUM_COLS
}
 

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)
 

Macro Definition Documentation

◆ DT_CRAWLER_FOLDER_CACHE_MAX

#define DT_CRAWLER_FOLDER_CACHE_MAX   32

Definition at line 222 of file crawler.c.

Typedef Documentation

◆ dt_control_crawler_cols_t

◆ dt_control_crawler_gui_t

◆ dt_control_crawler_result_t

◆ dt_crawler_folder_t

◆ dt_crawler_walk_t

Enumeration Type Documentation

◆ dt_control_crawler_cols_t

Enumerator
DT_CONTROL_CRAWLER_COL_ID 
DT_CONTROL_CRAWLER_COL_IMAGE_PATH 
DT_CONTROL_CRAWLER_COL_XMP_PATH 
DT_CONTROL_CRAWLER_COL_TS_XMP 
DT_CONTROL_CRAWLER_COL_TS_DB 
DT_CONTROL_CRAWLER_COL_TS_XMP_INT 
DT_CONTROL_CRAWLER_COL_TS_DB_INT 
DT_CONTROL_CRAWLER_COL_REPORT 
DT_CONTROL_CRAWLER_COL_TIME_DELTA 
DT_CONTROL_CRAWLER_NUM_COLS 

Definition at line 60 of file crawler.c.

Function Documentation

◆ _append_row_to_remove()

static void _append_row_to_remove ( GtkTreeModel *  model,
GtkTreePath *  path,
GList **  rowref_list 
)
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().

◆ _crawl_image()

◆ _crawler_folder()

◆ _crawler_job_run()

static int32_t _crawler_job_run ( dt_job_t job)
static

◆ _crawler_run()

◆ _crawler_show_results()

static gboolean _crawler_show_results ( gpointer  user_data)
static

Definition at line 543 of file crawler.c.

References dt_control_crawler_show_image_list().

Referenced by _crawler_job_run().

◆ _delete_selected_rows()

◆ _folded_key()

static gchar * _folded_key ( const char *  name)
static

Definition at line 186 of file crawler.c.

References dt_free, key, and name.

Referenced by _folder_holds().

◆ _folder_holds()

static gboolean _folder_holds ( dt_crawler_folder_t folder,
const char *  name,
time_t *  mtime 
)
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().

◆ _free_crawler_result()

◆ _free_crawler_results()

static void _free_crawler_results ( GList *  results)
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().

◆ _free_folder()

static void _free_folder ( gpointer  p)
static

Definition at line 176 of file crawler.c.

References dt_free, folder, IS_NULL_PTR, and p.

Referenced by _crawler_run().

◆ _get_crawler_entry_from_model()

◆ _job_cancelled()

static gboolean _job_cancelled ( dt_job_t job)
static

◆ _log_synchronization()

static void _log_synchronization ( dt_control_crawler_gui_t gui,
gchar *  pattern,
gchar *  filepath 
)
static

◆ _newest_button_clicked()

static void _newest_button_clicked ( GtkButton *  button,
gpointer  user_data 
)
static

◆ _oldest_button_clicked()

static void _oldest_button_clicked ( GtkButton *  button,
gpointer  user_data 
)
static

◆ _overwrite_button_clicked()

void _overwrite_button_clicked ( GtkButton *  button,
gpointer  user_data 
)

◆ _reload_button_clicked()

static void _reload_button_clicked ( GtkButton *  button,
gpointer  user_data 
)
static

◆ _select_all_callback()

static void _select_all_callback ( GtkButton *  button,
gpointer  user_data 
)
static

Definition at line 636 of file crawler.c.

References dt_control_crawler_gui_t::tree.

Referenced by dt_control_crawler_show_image_list().

◆ _select_invert_callback()

static void _select_invert_callback ( GtkButton *  button,
gpointer  user_data 
)
static

◆ _select_none_callback()

static void _select_none_callback ( GtkButton *  button,
gpointer  user_data 
)
static

Definition at line 645 of file crawler.c.

References dt_control_crawler_gui_t::tree.

Referenced by dt_control_crawler_show_image_list().

◆ _set_modification_time()

static void _set_modification_time ( char *  filename,
const time_t  timestamp 
)
static

Definition at line 96 of file crawler.c.

Referenced by sync_db_to_xmp(), sync_newest_to_oldest(), and sync_oldest_to_newest().

◆ _sibling_name()

static gchar * _sibling_name ( const char *  name,
const char *  ext 
)
static

Definition at line 334 of file crawler.c.

References name.

Referenced by _crawl_image().

◆ dt_control_crawler_response_callback()

static void dt_control_crawler_response_callback ( GtkWidget dialog,
const gint  response_id,
gpointer  user_data 
)
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().

◆ dt_control_crawler_run()

◆ dt_control_crawler_run_in_background()

void dt_control_crawler_run_in_background ( void  )

◆ dt_control_crawler_show_image_list()

◆ str_time_delta()

static gchar * str_time_delta ( const int  time_delta)
static

Definition at line 971 of file crawler.c.

Referenced by dt_control_crawler_show_image_list().

◆ sync_db_to_xmp()

◆ sync_newest_to_oldest()

◆ sync_oldest_to_newest()

◆ sync_xmp_to_db()