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 <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 "database/database.h"
#include "database/image_repository.h"
#include "common/image.h"
#include "common/utility.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_control_crawler_gui_t
 

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_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 _set_modification_time (char *filename, const time_t timestamp)
 
static void _crawl_image (const int32_t id, const int64_t timestamp, const int version, const char *image_path, const int flags, void *user_data)
 
GListdt_control_crawler_run (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 Documentation

◆ dt_control_crawler_cols_t

◆ dt_control_crawler_gui_t

◆ dt_control_crawler_result_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 57 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 346 of file crawler.c.

References L, and model.

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

◆ _crawl_image()

static void _crawl_image ( const int32_t  id,
const int64_t  timestamp,
const int  version,
const char *  image_path,
const int  flags,
void user_data 
)
static

◆ _delete_selected_rows()

◆ _free_crawler_result()

◆ _get_crawler_entry_from_model()

◆ _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 297 of file crawler.c.

References L, and 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 306 of file crawler.c.

References L, and 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 86 of file crawler.c.

References L.

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

◆ 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 261 of file crawler.c.

References dt_free, L, and dt_control_crawler_gui_t::model.

Referenced by dt_control_crawler_show_image_list().

◆ dt_control_crawler_run()

GList * dt_control_crawler_run ( )

this isn't a background job on purpose. it has to be really fast so it shouldn't require locking from image cache or anything like that. should we find out that we want to have a background job that crawls over all images we can maybe refactor this, but for now it's good the way it is.

Definition at line 236 of file crawler.c.

References _crawl_image(), dt_database_release_transaction, dt_database_start_transaction, dt_image_repository_foreach_with_path(), and L.

Referenced by crawl_xmp_changes(), and dt_init().

◆ dt_control_crawler_show_image_list()

◆ str_time_delta()

static gchar * str_time_delta ( const int  time_delta)
static

Definition at line 632 of file crawler.c.

References L.

Referenced by dt_control_crawler_show_image_list().

◆ sync_db_to_xmp()

◆ sync_newest_to_oldest()

◆ sync_oldest_to_newest()

◆ sync_xmp_to_db()