Commit 9d84ba50 authored by Christian Hergert's avatar Christian Hergert
Browse files

code-index: port index builder to IdeTask

We have more control over where things are freed using IdeTask,
and we can use this object as a way to catch any issues that
might still exist before we push things through the rest of the
code base.

That said, I've used IdeTask to catch lots of bugs already, so
I'm pretty confident in it's usage now.
parent 6b9b5a28
...@@ -105,7 +105,7 @@ enum { ...@@ -105,7 +105,7 @@ enum {
N_PROPS N_PROPS
}; };
static void build_tick (GTask *task); static void build_tick (IdeTask *task);
G_DEFINE_TYPE (IdeCodeIndexBuilder, ide_code_index_builder, IDE_TYPE_OBJECT) G_DEFINE_TYPE (IdeCodeIndexBuilder, ide_code_index_builder, IDE_TYPE_OBJECT)
...@@ -643,7 +643,7 @@ get_changes_collect_files_cb (gpointer data, ...@@ -643,7 +643,7 @@ get_changes_collect_files_cb (gpointer data,
} }
static void static void
get_changes_worker (GTask *task, get_changes_worker (IdeTask *task,
gpointer source_object, gpointer source_object,
gpointer task_data, gpointer task_data,
GCancellable *cancellable) GCancellable *cancellable)
...@@ -652,7 +652,7 @@ get_changes_worker (GTask *task, ...@@ -652,7 +652,7 @@ get_changes_worker (GTask *task,
GetChangesData *gcd = task_data; GetChangesData *gcd = task_data;
g_assert (!IDE_IS_MAIN_THREAD ()); g_assert (!IDE_IS_MAIN_THREAD ());
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
g_assert (IDE_IS_CODE_INDEX_BUILDER (source_object)); g_assert (IDE_IS_CODE_INDEX_BUILDER (source_object));
g_assert (gcd != NULL); g_assert (gcd != NULL);
g_assert (IS_GET_CHANGES (gcd)); g_assert (IS_GET_CHANGES (gcd));
...@@ -660,7 +660,7 @@ get_changes_worker (GTask *task, ...@@ -660,7 +660,7 @@ get_changes_worker (GTask *task,
g_assert (G_IS_FILE (gcd->index_dir)); g_assert (G_IS_FILE (gcd->index_dir));
g_assert (IDE_IS_VCS (gcd->vcs)); g_assert (IDE_IS_VCS (gcd->vcs));
if (g_task_return_error_if_cancelled (task)) if (ide_task_return_error_if_cancelled (task))
return; return;
/* /*
...@@ -681,7 +681,7 @@ get_changes_worker (GTask *task, ...@@ -681,7 +681,7 @@ get_changes_worker (GTask *task,
*/ */
to_update = g_ptr_array_new_with_free_func (g_object_unref); to_update = g_ptr_array_new_with_free_func (g_object_unref);
if (g_task_return_error_if_cancelled (task)) if (ide_task_return_error_if_cancelled (task))
return; return;
/* /*
...@@ -718,7 +718,7 @@ get_changes_worker (GTask *task, ...@@ -718,7 +718,7 @@ get_changes_worker (GTask *task,
g_queue_foreach (&files, (GFunc)file_info_free, NULL); g_queue_foreach (&files, (GFunc)file_info_free, NULL);
if (g_task_return_error_if_cancelled (task)) if (ide_task_return_error_if_cancelled (task))
return; return;
} }
...@@ -734,9 +734,9 @@ get_changes_worker (GTask *task, ...@@ -734,9 +734,9 @@ get_changes_worker (GTask *task,
g_assert (G_IS_FILE (gcd->data_dir)); g_assert (G_IS_FILE (gcd->data_dir));
g_assert (G_IS_FILE (gcd->index_dir)); g_assert (G_IS_FILE (gcd->index_dir));
g_task_return_pointer (task, ide_task_return_pointer (task,
g_steal_pointer (&to_update), g_steal_pointer (&to_update),
(GDestroyNotify) g_ptr_array_unref); (GDestroyNotify) g_ptr_array_unref);
} }
/* /*
...@@ -761,7 +761,7 @@ get_changes_async (IdeCodeIndexBuilder *self, ...@@ -761,7 +761,7 @@ get_changes_async (IdeCodeIndexBuilder *self,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
g_autoptr(GTask) task = NULL; g_autoptr(IdeTask) task = NULL;
GetChangesData *gcd; GetChangesData *gcd;
IdeContext *context; IdeContext *context;
IdeVcs *vcs; IdeVcs *vcs;
...@@ -775,9 +775,10 @@ get_changes_async (IdeCodeIndexBuilder *self, ...@@ -775,9 +775,10 @@ get_changes_async (IdeCodeIndexBuilder *self,
context = ide_object_get_context (IDE_OBJECT (self)); context = ide_object_get_context (IDE_OBJECT (self));
vcs = ide_context_get_vcs (context); vcs = ide_context_get_vcs (context);
task = g_task_new (self, cancellable, callback, user_data); task = ide_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, get_changes_async); ide_task_set_source_tag (task, get_changes_async);
g_task_set_priority (task, G_PRIORITY_LOW); ide_task_set_priority (task, G_PRIORITY_LOW);
ide_task_set_kind (task, IDE_THREAD_POOL_INDEXER);
gcd = g_slice_new0 (GetChangesData); gcd = g_slice_new0 (GetChangesData);
gcd->magic = GET_CHANGES_MAGIC; gcd->magic = GET_CHANGES_MAGIC;
...@@ -786,11 +787,11 @@ get_changes_async (IdeCodeIndexBuilder *self, ...@@ -786,11 +787,11 @@ get_changes_async (IdeCodeIndexBuilder *self,
gcd->index_dir = g_object_ref (index_dir); gcd->index_dir = g_object_ref (index_dir);
gcd->recursive = !!recursive; gcd->recursive = !!recursive;
gcd->vcs = g_object_ref (vcs); gcd->vcs = g_object_ref (vcs);
g_task_set_task_data (task, gcd, (GDestroyNotify)get_changes_data_free); ide_task_set_task_data (task, gcd, (GDestroyNotify)get_changes_data_free);
g_queue_push_head (&gcd->directories, g_object_ref (data_dir)); g_queue_push_head (&gcd->directories, g_object_ref (data_dir));
ide_thread_pool_push_task (IDE_THREAD_POOL_INDEXER, task, get_changes_worker); ide_task_run_in_thread (task, get_changes_worker);
} }
static GPtrArray * static GPtrArray *
...@@ -800,9 +801,9 @@ get_changes_finish (IdeCodeIndexBuilder *self, ...@@ -800,9 +801,9 @@ get_changes_finish (IdeCodeIndexBuilder *self,
{ {
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_CODE_INDEX_BUILDER (self)); g_assert (IDE_IS_CODE_INDEX_BUILDER (self));
g_assert (G_IS_TASK (result)); g_assert (IDE_IS_TASK (result));
return g_task_propagate_pointer (G_TASK (result), error); return ide_task_propagate_pointer (IDE_TASK (result), error);
} }
/** /**
...@@ -912,7 +913,7 @@ add_entries_to_index (IdeCodeIndexEntries *entries, ...@@ -912,7 +913,7 @@ add_entries_to_index (IdeCodeIndexEntries *entries,
} }
static void static void
index_directory_worker (GTask *task, index_directory_worker (IdeTask *task,
gpointer source_object, gpointer source_object,
gpointer task_data, gpointer task_data,
GCancellable *cancellable) GCancellable *cancellable)
...@@ -922,7 +923,7 @@ index_directory_worker (GTask *task, ...@@ -922,7 +923,7 @@ index_directory_worker (GTask *task,
g_autoptr(GFile) keys = NULL; g_autoptr(GFile) keys = NULL;
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
g_assert (IDE_IS_CODE_INDEX_BUILDER (source_object)); g_assert (IDE_IS_CODE_INDEX_BUILDER (source_object));
g_assert (idd != NULL); g_assert (idd != NULL);
g_assert (IS_INDEX_DIRECTORY (idd)); g_assert (IS_INDEX_DIRECTORY (idd));
...@@ -938,23 +939,23 @@ index_directory_worker (GTask *task, ...@@ -938,23 +939,23 @@ index_directory_worker (GTask *task,
if (!ide_persistent_map_builder_write (idd->map, keys, 0, cancellable, &error) || if (!ide_persistent_map_builder_write (idd->map, keys, 0, cancellable, &error) ||
!dzl_fuzzy_index_builder_write (idd->fuzzy, names, 0, cancellable, &error)) !dzl_fuzzy_index_builder_write (idd->fuzzy, names, 0, cancellable, &error))
g_task_return_error (task, g_steal_pointer (&error)); ide_task_return_error (task, g_steal_pointer (&error));
else else
g_task_return_boolean (task, TRUE); ide_task_return_boolean (task, TRUE);
} }
static gboolean static gboolean
add_entries_to_index_cb (gpointer data) add_entries_to_index_cb (gpointer data)
{ {
AddEntriesData *task_data; AddEntriesData *task_data;
GTask *task = data; IdeTask *task = data;
gint64 deadline; gint64 deadline;
gboolean has_more; gboolean has_more;
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
task_data = g_task_get_task_data (task); task_data = ide_task_get_task_data (task);
g_assert (task_data != NULL); g_assert (task_data != NULL);
g_assert (IDE_IS_CODE_INDEX_ENTRIES (task_data->entries)); g_assert (IDE_IS_CODE_INDEX_ENTRIES (task_data->entries));
g_assert (IDE_IS_PERSISTENT_MAP_BUILDER (task_data->map_builder)); g_assert (IDE_IS_PERSISTENT_MAP_BUILDER (task_data->map_builder));
...@@ -971,7 +972,7 @@ add_entries_to_index_cb (gpointer data) ...@@ -971,7 +972,7 @@ add_entries_to_index_cb (gpointer data)
/* Complete task if there's nothing more */ /* Complete task if there's nothing more */
if (!has_more) if (!has_more)
g_task_return_boolean (task, TRUE); ide_task_return_boolean (task, TRUE);
return has_more; return has_more;
} }
...@@ -986,7 +987,7 @@ add_entries_to_index_async (IdeCodeIndexBuilder *self, ...@@ -986,7 +987,7 @@ add_entries_to_index_async (IdeCodeIndexBuilder *self,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
g_autoptr(GTask) task = NULL; g_autoptr(IdeTask) task = NULL;
AddEntriesData *task_data; AddEntriesData *task_data;
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
...@@ -997,11 +998,11 @@ add_entries_to_index_async (IdeCodeIndexBuilder *self, ...@@ -997,11 +998,11 @@ add_entries_to_index_async (IdeCodeIndexBuilder *self,
g_assert (DZL_IS_FUZZY_INDEX_BUILDER (fuzzy_builder)); g_assert (DZL_IS_FUZZY_INDEX_BUILDER (fuzzy_builder));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable)); g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
task = g_task_new (self, cancellable, callback, user_data); task = ide_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, add_entries_to_index_async); ide_task_set_source_tag (task, add_entries_to_index_async);
g_task_set_priority (task, G_PRIORITY_LOW); ide_task_set_priority (task, G_PRIORITY_LOW);
if (g_task_return_error_if_cancelled (task)) if (ide_task_return_error_if_cancelled (task))
return; return;
task_data = g_slice_new0 (AddEntriesData); task_data = g_slice_new0 (AddEntriesData);
...@@ -1009,7 +1010,7 @@ add_entries_to_index_async (IdeCodeIndexBuilder *self, ...@@ -1009,7 +1010,7 @@ add_entries_to_index_async (IdeCodeIndexBuilder *self,
task_data->map_builder = g_object_ref (map_builder); task_data->map_builder = g_object_ref (map_builder);
task_data->fuzzy_builder = g_object_ref (fuzzy_builder); task_data->fuzzy_builder = g_object_ref (fuzzy_builder);
task_data->file_id = file_id; task_data->file_id = file_id;
g_task_set_task_data (task, task_data, (GDestroyNotify)add_entries_data_free); ide_task_set_task_data (task, task_data, (GDestroyNotify)add_entries_data_free);
/* Super low priority to avoid UI stalls */ /* Super low priority to avoid UI stalls */
g_idle_add_full (G_PRIORITY_LOW + 1000, g_idle_add_full (G_PRIORITY_LOW + 1000,
...@@ -1024,20 +1025,20 @@ add_entries_to_index_finish (IdeCodeIndexBuilder *self, ...@@ -1024,20 +1025,20 @@ add_entries_to_index_finish (IdeCodeIndexBuilder *self,
GError **error) GError **error)
{ {
g_assert (IDE_IS_CODE_INDEX_BUILDER (self)); g_assert (IDE_IS_CODE_INDEX_BUILDER (self));
g_assert (G_IS_TASK (result)); g_assert (IDE_IS_TASK (result));
return g_task_propagate_boolean (G_TASK (result), error); return ide_task_propagate_boolean (IDE_TASK (result), error);
} }
static void static void
dec_active_and_maybe_complete (GTask *task) dec_active_and_maybe_complete (IdeTask *task)
{ {
IndexDirectoryData *idd; IndexDirectoryData *idd;
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
idd = g_task_get_task_data (task); idd = ide_task_get_task_data (task);
g_assert (idd != NULL); g_assert (idd != NULL);
g_assert (IS_INDEX_DIRECTORY (idd)); g_assert (IS_INDEX_DIRECTORY (idd));
g_assert (G_IS_FILE (idd->index_dir)); g_assert (G_IS_FILE (idd->index_dir));
...@@ -1049,7 +1050,7 @@ dec_active_and_maybe_complete (GTask *task) ...@@ -1049,7 +1050,7 @@ dec_active_and_maybe_complete (GTask *task)
if (idd->n_active == 0) if (idd->n_active == 0)
{ {
dzl_fuzzy_index_builder_set_metadata_uint32 (idd->fuzzy, "n_files", idd->n_files); dzl_fuzzy_index_builder_set_metadata_uint32 (idd->fuzzy, "n_files", idd->n_files);
g_task_run_in_thread (task, index_directory_worker); ide_task_run_in_thread (task, index_directory_worker);
} }
} }
...@@ -1060,12 +1061,12 @@ index_directory_add_entries_cb (GObject *object, ...@@ -1060,12 +1061,12 @@ index_directory_add_entries_cb (GObject *object,
{ {
IdeCodeIndexBuilder *self = (IdeCodeIndexBuilder *)object; IdeCodeIndexBuilder *self = (IdeCodeIndexBuilder *)object;
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
g_autoptr(GTask) task = user_data; g_autoptr(IdeTask) task = user_data;
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_CODE_INDEX_BUILDER (self)); g_assert (IDE_IS_CODE_INDEX_BUILDER (self));
g_assert (G_IS_ASYNC_RESULT (result)); g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
if (!add_entries_to_index_finish (self, result, &error)) if (!add_entries_to_index_finish (self, result, &error))
maybe_log_error (error); maybe_log_error (error);
...@@ -1081,7 +1082,7 @@ index_directory_index_file_cb (GObject *object, ...@@ -1081,7 +1082,7 @@ index_directory_index_file_cb (GObject *object,
IdeCodeIndexer *indexer = (IdeCodeIndexer *)object; IdeCodeIndexer *indexer = (IdeCodeIndexer *)object;
g_autoptr(IdeCodeIndexEntries) entries = NULL; g_autoptr(IdeCodeIndexEntries) entries = NULL;
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
g_autoptr(GTask) task = user_data; g_autoptr(IdeTask) task = user_data;
IdeCodeIndexBuilder *self; IdeCodeIndexBuilder *self;
IndexDirectoryData *idd; IndexDirectoryData *idd;
GCancellable *cancellable; GCancellable *cancellable;
...@@ -1089,9 +1090,9 @@ index_directory_index_file_cb (GObject *object, ...@@ -1089,9 +1090,9 @@ index_directory_index_file_cb (GObject *object,
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_CODE_INDEXER (indexer)); g_assert (IDE_IS_CODE_INDEXER (indexer));
g_assert (G_IS_ASYNC_RESULT (result)); g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
idd = g_task_get_task_data (task); idd = ide_task_get_task_data (task);
g_assert (idd != NULL); g_assert (idd != NULL);
g_assert (IS_INDEX_DIRECTORY (idd)); g_assert (IS_INDEX_DIRECTORY (idd));
g_assert (G_IS_FILE (idd->index_dir)); g_assert (G_IS_FILE (idd->index_dir));
...@@ -1107,10 +1108,10 @@ index_directory_index_file_cb (GObject *object, ...@@ -1107,10 +1108,10 @@ index_directory_index_file_cb (GObject *object,
return; return;
} }
self = g_task_get_source_object (task); self = ide_task_get_source_object (task);
g_assert (IDE_IS_CODE_INDEX_BUILDER (self)); g_assert (IDE_IS_CODE_INDEX_BUILDER (self));
cancellable = g_task_get_cancellable (task); cancellable = ide_task_get_cancellable (task);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable)); g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
add_entries_to_index_async (self, add_entries_to_index_async (self,
...@@ -1132,7 +1133,7 @@ index_directory_async (IdeCodeIndexBuilder *self, ...@@ -1132,7 +1133,7 @@ index_directory_async (IdeCodeIndexBuilder *self,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
g_autoptr(GTask) task = NULL; g_autoptr(IdeTask) task = NULL;
IndexDirectoryData *idd; IndexDirectoryData *idd;
GHashTableIter iter; GHashTableIter iter;
gpointer k, v; gpointer k, v;
...@@ -1144,11 +1145,11 @@ index_directory_async (IdeCodeIndexBuilder *self, ...@@ -1144,11 +1145,11 @@ index_directory_async (IdeCodeIndexBuilder *self,
g_assert (build_flags != NULL); g_assert (build_flags != NULL);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable)); g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
task = g_task_new (self, cancellable, callback, user_data); task = ide_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, index_directory_async); ide_task_set_source_tag (task, index_directory_async);
g_task_set_priority (task, G_PRIORITY_LOW); ide_task_set_priority (task, G_PRIORITY_LOW);
if (g_task_return_error_if_cancelled (task)) if (ide_task_return_error_if_cancelled (task))
return; return;
idd = g_slice_new0 (IndexDirectoryData); idd = g_slice_new0 (IndexDirectoryData);
...@@ -1156,7 +1157,7 @@ index_directory_async (IdeCodeIndexBuilder *self, ...@@ -1156,7 +1157,7 @@ index_directory_async (IdeCodeIndexBuilder *self,
idd->index_dir = g_object_ref (index_dir); idd->index_dir = g_object_ref (index_dir);
idd->fuzzy = dzl_fuzzy_index_builder_new (); idd->fuzzy = dzl_fuzzy_index_builder_new ();
idd->map = ide_persistent_map_builder_new (); idd->map = ide_persistent_map_builder_new ();
g_task_set_task_data (task, idd, (GDestroyNotify)index_directory_data_free); ide_task_set_task_data (task, idd, (GDestroyNotify)index_directory_data_free);
g_hash_table_iter_init (&iter, build_flags); g_hash_table_iter_init (&iter, build_flags);
...@@ -1190,7 +1191,7 @@ index_directory_async (IdeCodeIndexBuilder *self, ...@@ -1190,7 +1191,7 @@ index_directory_async (IdeCodeIndexBuilder *self,
idd->n_active--; idd->n_active--;
if (idd->n_active == 0) if (idd->n_active == 0)
g_task_return_boolean (task, TRUE); ide_task_return_boolean (task, TRUE);
} }
static gboolean static gboolean
...@@ -1200,10 +1201,10 @@ index_directory_finish (IdeCodeIndexBuilder *self, ...@@ -1200,10 +1201,10 @@ index_directory_finish (IdeCodeIndexBuilder *self,
{ {
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_CODE_INDEX_BUILDER (self)); g_assert (IDE_IS_CODE_INDEX_BUILDER (self));
g_assert (G_IS_TASK (result)); g_assert (IDE_IS_TASK (result));
g_assert (g_task_is_valid (G_TASK (result), self)); g_assert (ide_task_is_valid (IDE_TASK (result), self));
return g_task_propagate_boolean (G_TASK (result), error); return ide_task_propagate_boolean (IDE_TASK (result), error);
} }
static void static void
...@@ -1212,19 +1213,19 @@ build_index_directory_cb (GObject *object, ...@@ -1212,19 +1213,19 @@ build_index_directory_cb (GObject *object,
gpointer user_data) gpointer user_data)
{ {
IdeCodeIndexBuilder *self = (IdeCodeIndexBuilder *)object; IdeCodeIndexBuilder *self = (IdeCodeIndexBuilder *)object;
g_autoptr(GTask) task = user_data; g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
BuildData *bd; BuildData *bd;
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_CODE_INDEX_BUILDER (self)); g_assert (IDE_IS_CODE_INDEX_BUILDER (self));
g_assert (G_IS_ASYNC_RESULT (result)); g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
if (g_task_return_error_if_cancelled (task)) if (ide_task_return_error_if_cancelled (task))
return; return;
bd = g_task_get_task_data (task); bd = ide_task_get_task_data (task);
g_assert (bd != NULL); g_assert (bd != NULL);
g_assert (IS_BUILD_DATA (bd)); g_assert (IS_BUILD_DATA (bd));
g_assert (G_IS_FILE (bd->building_data_dir)); g_assert (G_IS_FILE (bd->building_data_dir));
...@@ -1247,7 +1248,7 @@ build_get_build_flags_cb (GObject *object, ...@@ -1247,7 +1248,7 @@ build_get_build_flags_cb (GObject *object,
gpointer user_data) gpointer user_data)
{ {
IdeBuildSystem *build_system = (IdeBuildSystem *)object; IdeBuildSystem *build_system = (IdeBuildSystem *)object;
g_autoptr(GTask) task = user_data; g_autoptr(IdeTask) task = user_data;
g_autoptr(GHashTable) flags = NULL; g_autoptr(GHashTable) flags = NULL;
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
g_autoptr(GFile) data_dir = NULL; g_autoptr(GFile) data_dir = NULL;
...@@ -1260,9 +1261,9 @@ build_get_build_flags_cb (GObject *object, ...@@ -1260,9 +1261,9 @@ build_get_build_flags_cb (GObject *object,
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (IDE_IS_BUILD_SYSTEM (build_system)); g_assert (IDE_IS_BUILD_SYSTEM (build_system));
g_assert (G_IS_ASYNC_RESULT (result)); g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
bd = g_task_get_task_data (task); bd = ide_task_get_task_data (task);
g_assert (bd != NULL); g_assert (bd != NULL);
g_assert (G_IS_FILE (bd->data_dir)); g_assert (G_IS_FILE (bd->data_dir));
g_assert (G_IS_FILE (bd->index_dir)); g_assert (G_IS_FILE (bd->index_dir));
...@@ -1281,10 +1282,10 @@ build_get_build_flags_cb (GObject *object, ...@@ -1281,10 +1282,10 @@ build_get_build_flags_cb (GObject *object,
return; return;
} }
self = g_task_get_source_object (task); self = ide_task_get_source_object (task);
g_assert (IDE_IS_CODE_INDEX_BUILDER (self)); g_assert (IDE_IS_CODE_INDEX_BUILDER (self));
cancellable = g_task_get_cancellable (task); cancellable = ide_task_get_cancellable (task);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable)); g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
index_dir = get_index_dir (bd->index_dir, bd->data_dir, data_dir); index_dir = get_index_dir (bd->index_dir, bd->data_dir, data_dir);
...@@ -1311,19 +1312,19 @@ build_get_build_flags_cb (GObject *object, ...@@ -1311,19 +1312,19 @@ build_get_build_flags_cb (GObject *object,
} }
static void static void
build_tick (GTask *task) build_tick (IdeTask *task)
{ {
GCancellable *cancellable; GCancellable *cancellable;
BuildData *bd; BuildData *bd;
GFile *data_dir; GFile *data_dir;
g_assert (IDE_IS_MAIN_THREAD ()); g_assert (IDE_IS_MAIN_THREAD ());
g_assert (G_IS_TASK (task)); g_assert (IDE_IS_TASK (task));
if (g_task_return_error_if_cancelled (task)) if (ide_task_return_error_if_cancelled (task))
return; return;