Commit fdd4bcc3 authored by Carlos Garnacho's avatar Carlos Garnacho

libtracker-data: Pass virtual table data on TrackerDBManager construction

There are paths where the TrackerDBManager may create the writable interface
early within tracker_db_manager_new(), setting the vtab data later will
work for database interfaces created later on, but not for the already
created ones.

Pass the vtab data as (yet...) another argument to tracker_db_manager_new()
so it is available anytime for the interfaces that will be later created.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1683903
parent e8282c8d
Pipeline #79086 passed with stage
in 2 minutes and 10 seconds
......@@ -4201,15 +4201,13 @@ tracker_data_manager_initable_init (GInitable *initable,
manager->update_cache_size,
busy_callback, manager, "",
G_OBJECT (manager),
manager->ontologies,
&internal_error);
if (!manager->db_manager) {
g_propagate_error (error, internal_error);
return FALSE;
}
tracker_db_manager_set_vtab_user_data (manager->db_manager,
manager->ontologies);
manager->first_time_index = is_first_time_index;
tracker_data_manager_update_status (manager, "Initializing data manager");
......@@ -4801,9 +4799,6 @@ tracker_data_manager_initable_init (GInitable *initable,
}
}
tracker_db_manager_set_vtab_user_data (manager->db_manager,
manager->ontologies);
skip_ontology_check:
#ifndef DISABLE_JOURNAL
......
......@@ -586,6 +586,7 @@ tracker_db_manager_new (TrackerDBManagerFlags flags,
gpointer busy_user_data,
const gchar *busy_operation,
GObject *iface_data,
gpointer vtab_data,
GError **error)
{
TrackerDBManager *db_manager;
......@@ -605,6 +606,7 @@ tracker_db_manager_new (TrackerDBManagerFlags flags,
}
db_manager = g_new0 (TrackerDBManager, 1);
db_manager->vtab_data = vtab_data;
/* First set defaults for return values */
if (first_time) {
......@@ -1263,10 +1265,3 @@ tracker_db_manager_check_perform_vacuum (TrackerDBManager *db_manager)
iface = tracker_db_manager_get_writable_db_interface (db_manager);
tracker_db_interface_execute_query (iface, NULL, "VACUUM");
}
void
tracker_db_manager_set_vtab_user_data (TrackerDBManager *db_manager,
gpointer user_data)
{
db_manager->vtab_data = user_data;
}
......@@ -55,6 +55,7 @@ TrackerDBManager *tracker_db_manager_new (TrackerDBManagerF
gpointer busy_user_data,
const gchar *busy_operation,
GObject *iface_data,
gpointer vtab_data,
GError **error);
void tracker_db_manager_free (TrackerDBManager *db_manager);
void tracker_db_manager_remove_all (TrackerDBManager *db_manager);
......@@ -95,9 +96,6 @@ void tracker_db_manager_tokenizer_update (TrackerDBManager
void tracker_db_manager_check_perform_vacuum (TrackerDBManager *db_manager);
void tracker_db_manager_set_vtab_user_data (TrackerDBManager *db_manager,
gpointer user_data);
G_END_DECLS
#endif /* __LIBTRACKER_DB_MANAGER_H__ */
......@@ -274,6 +274,7 @@ reset_run (void)
NULL,
NULL,
NULL,
NULL,
&error);
if (!db_manager) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment