[gnome-builder] plugins: port remaining plugins to IdeTask
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins: port remaining plugins to IdeTask
- Date: Thu, 22 Mar 2018 00:11:22 +0000 (UTC)
commit d990356bb5dc57637ecf499e4647abc12d71ef4b
Author: Christian Hergert <chergert redhat com>
Date: Wed Mar 21 17:07:04 2018 -0700
plugins: port remaining plugins to IdeTask
This converts the rest of plugin files that are not using DzlTaskCache to
IdeTask. Those modules will have to be converted on a per-function basis.
.../autotools/ide-autotools-autogen-stage.c | 22 +-
.../ide-autotools-build-target-provider.c | 38 +--
src/plugins/autotools/ide-autotools-make-stage.c | 38 +--
.../autotools/ide-autotools-makecache-stage.c | 28 +-
src/plugins/beautifier/gb-beautifier-helper.c | 30 +-
src/plugins/beautifier/gb-beautifier-process.c | 38 +--
.../gbp-create-project-genesis-addin.c | 16 +-
.../create-project/gbp-create-project-tool.c | 40 +--
.../create-project/gbp-create-project-widget.c | 44 +--
src/plugins/deviced/gbp-deviced-deploy-strategy.c | 66 ++--
src/plugins/deviced/gbp-deviced-device-provider.c | 18 +-
src/plugins/deviced/gbp-deviced-device.c | 122 ++++----
src/plugins/file-search/gb-file-search-provider.c | 14 +-
src/plugins/gdb/gbp-gdb-debugger.c | 336 ++++++++++-----------
.../gettext/ide-gettext-diagnostic-provider.c | 48 +--
.../ide-gca-diagnostic-provider.c | 84 +++---
.../gnome-code-assistance/ide-gca-service.c | 36 +--
.../meson/gbp-meson-build-target-provider.c | 88 +++---
src/plugins/meson/gbp-meson-test-provider.c | 42 +--
src/plugins/spellcheck/gbp-spell-dict.c | 44 +--
.../symbol-tree/gbp-symbol-layout-stack-addin.c | 40 +--
src/plugins/terminal/gb-terminal-view-actions.c | 30 +-
src/plugins/xml-pack/ide-xml-diagnostic-provider.c | 22 +-
src/plugins/xml-pack/ide-xml-symbol-node.c | 12 +-
src/plugins/xml-pack/ide-xml-symbol-resolver.c | 42 +--
25 files changed, 669 insertions(+), 669 deletions(-)
---
diff --git a/src/plugins/autotools/ide-autotools-autogen-stage.c
b/src/plugins/autotools/ide-autotools-autogen-stage.c
index 435f567c9..31058d61c 100644
--- a/src/plugins/autotools/ide-autotools-autogen-stage.c
+++ b/src/plugins/autotools/ide-autotools-autogen-stage.c
@@ -43,16 +43,16 @@ ide_autotools_autogen_stage_wait_check_cb (GObject *object,
gpointer user_data)
{
IdeSubprocess *subprocess = (IdeSubprocess *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_assert (IDE_IS_SUBPROCESS (subprocess));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!ide_subprocess_wait_check_finish (subprocess, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
static void
@@ -66,14 +66,14 @@ ide_autotools_autogen_stage_execute_async (IdeBuildStage *stage,
g_autofree gchar *autogen_path = NULL;
g_autoptr(IdeSubprocessLauncher) launcher = NULL;
g_autoptr(IdeSubprocess) subprocess = NULL;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GError) error = NULL;
g_assert (IDE_IS_AUTOTOOLS_AUTOGEN_STAGE (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_autotools_autogen_stage_execute_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_autotools_autogen_stage_execute_async);
autogen_path = g_build_filename (self->srcdir, "autogen.sh", NULL);
@@ -81,7 +81,7 @@ ide_autotools_autogen_stage_execute_async (IdeBuildStage *stage,
if (launcher == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -102,7 +102,7 @@ ide_autotools_autogen_stage_execute_async (IdeBuildStage *stage,
if (subprocess == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -120,9 +120,9 @@ ide_autotools_autogen_stage_execute_finish (IdeBuildStage *stage,
GError **error)
{
g_assert (IDE_IS_AUTOTOOLS_AUTOGEN_STAGE (stage));
- 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
diff --git a/src/plugins/autotools/ide-autotools-build-target-provider.c
b/src/plugins/autotools/ide-autotools-build-target-provider.c
index f1f93ffc5..1b4aa494a 100644
--- a/src/plugins/autotools/ide-autotools-build-target-provider.c
+++ b/src/plugins/autotools/ide-autotools-build-target-provider.c
@@ -48,7 +48,7 @@ ide_autotools_build_target_provider_get_targets_cb (GObject *object,
gpointer user_data)
{
IdeMakecache *makecache = (IdeMakecache *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GPtrArray) ret = NULL;
g_autoptr(GError) error = NULL;
@@ -56,14 +56,14 @@ ide_autotools_build_target_provider_get_targets_cb (GObject *object,
g_assert (IDE_IS_MAKECACHE (makecache));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
ret = ide_makecache_get_build_targets_finish (makecache, result, &error);
if (ret == NULL)
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify)g_ptr_array_unref);
IDE_EXIT;
}
@@ -75,7 +75,7 @@ ide_autotools_build_target_provider_get_targets_async (IdeBuildTargetProvider *p
gpointer user_data)
{
IdeAutotoolsBuildTargetProvider *self = (IdeAutotoolsBuildTargetProvider *)provider;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GFile) builddir_file = NULL;
IdeBuildPipeline *pipeline;
IdeBuildManager *build_manager;
@@ -89,19 +89,19 @@ ide_autotools_build_target_provider_get_targets_async (IdeBuildTargetProvider *p
g_assert (IDE_IS_AUTOTOOLS_BUILD_TARGET_PROVIDER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_autotools_build_target_provider_get_targets_async);
- g_task_set_priority (task, G_PRIORITY_LOW);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_autotools_build_target_provider_get_targets_async);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
context = ide_object_get_context (IDE_OBJECT (self));
build_system = ide_context_get_build_system (context);
if (!IDE_IS_AUTOTOOLS_BUILD_SYSTEM (build_system))
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- "Not an autotools build system, ignoring");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "Not an autotools build system, ignoring");
IDE_EXIT;
}
@@ -121,10 +121,10 @@ ide_autotools_build_target_provider_get_targets_async (IdeBuildTargetProvider *p
if (makecache == NULL)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- "Failed to locate makecache");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "Failed to locate makecache");
IDE_EXIT;
}
@@ -147,10 +147,10 @@ ide_autotools_build_target_provider_get_targets_finish (IdeBuildTargetProvider
IDE_ENTRY;
g_assert (IDE_IS_AUTOTOOLS_BUILD_TARGET_PROVIDER (provider));
- g_assert (G_IS_TASK (result));
- g_assert (g_task_is_valid (G_TASK (result), provider));
+ g_assert (IDE_IS_TASK (result));
+ g_assert (ide_task_is_valid (IDE_TASK (result), provider));
- ret = g_task_propagate_pointer (G_TASK (result), error);
+ ret = ide_task_propagate_pointer (IDE_TASK (result), error);
IDE_RETURN (ret);
}
diff --git a/src/plugins/autotools/ide-autotools-make-stage.c
b/src/plugins/autotools/ide-autotools-make-stage.c
index 8d77f8d9b..cbc6f1733 100644
--- a/src/plugins/autotools/ide-autotools-make-stage.c
+++ b/src/plugins/autotools/ide-autotools-make-stage.c
@@ -152,7 +152,7 @@ ide_autotools_make_stage_wait_cb (GObject *object,
gpointer user_data)
{
IdeSubprocess *subprocess = (IdeSubprocess *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
IDE_ENTRY;
@@ -161,9 +161,9 @@ ide_autotools_make_stage_wait_cb (GObject *object,
g_assert (G_IS_ASYNC_RESULT (result));
if (!ide_subprocess_wait_check_finish (subprocess, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
IDE_EXIT;
}
@@ -178,7 +178,7 @@ ide_autotools_make_stage_execute_async (IdeBuildStage *stage,
IdeAutotoolsMakeStage *self = (IdeAutotoolsMakeStage *)stage;
g_autoptr(IdeSubprocessLauncher) launcher = NULL;
g_autoptr(IdeSubprocess) subprocess = NULL;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GError) error = NULL;
g_autofree gchar *message = NULL;
const gchar * const *argv;
@@ -190,8 +190,8 @@ ide_autotools_make_stage_execute_async (IdeBuildStage *stage,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_autotools_make_stage_execute_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_autotools_make_stage_execute_async);
/* If we have a chained target, we just execute that instead */
if (self->chained_target)
@@ -202,7 +202,7 @@ ide_autotools_make_stage_execute_async (IdeBuildStage *stage,
if (target == NULL)
{
g_warning ("Improperly configured IdeAutotoolsMakeStage, no target set");
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
IDE_EXIT;
}
@@ -210,7 +210,7 @@ ide_autotools_make_stage_execute_async (IdeBuildStage *stage,
if (launcher == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -226,7 +226,7 @@ ide_autotools_make_stage_execute_async (IdeBuildStage *stage,
if (subprocess == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -250,9 +250,9 @@ ide_autotools_make_stage_execute_finish (IdeBuildStage *stage,
IDE_ENTRY;
g_assert (IDE_IS_BUILD_STAGE (stage));
- g_assert (G_IS_TASK (result));
+ g_assert (IDE_IS_TASK (result));
- ret = g_task_propagate_boolean (G_TASK (result), error);
+ ret = ide_task_propagate_boolean (IDE_TASK (result), error);
IDE_RETURN (ret);
}
@@ -267,7 +267,7 @@ ide_autotools_make_stage_clean_async (IdeBuildStage *stage,
IdeAutotoolsMakeStage *self = (IdeAutotoolsMakeStage *)stage;
g_autoptr(IdeSubprocessLauncher) launcher = NULL;
g_autoptr(IdeSubprocess) subprocess = NULL;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GError) error = NULL;
g_autofree gchar *message = NULL;
const gchar * const *argv;
@@ -278,12 +278,12 @@ ide_autotools_make_stage_clean_async (IdeBuildStage *stage,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_autotools_make_stage_clean_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_autotools_make_stage_clean_async);
if (self->clean_target == NULL)
{
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
IDE_EXIT;
}
@@ -291,7 +291,7 @@ ide_autotools_make_stage_clean_async (IdeBuildStage *stage,
if (launcher == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -304,7 +304,7 @@ ide_autotools_make_stage_clean_async (IdeBuildStage *stage,
if (subprocess == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -328,9 +328,9 @@ ide_autotools_make_stage_clean_finish (IdeBuildStage *stage,
IDE_ENTRY;
g_assert (IDE_IS_BUILD_STAGE (stage));
- g_assert (G_IS_TASK (result));
+ g_assert (IDE_IS_TASK (result));
- ret = g_task_propagate_boolean (G_TASK (result), error);
+ ret = ide_task_propagate_boolean (IDE_TASK (result), error);
IDE_RETURN (ret);
}
diff --git a/src/plugins/autotools/ide-autotools-makecache-stage.c
b/src/plugins/autotools/ide-autotools-makecache-stage.c
index 425eb67ae..fe9057a00 100644
--- a/src/plugins/autotools/ide-autotools-makecache-stage.c
+++ b/src/plugins/autotools/ide-autotools-makecache-stage.c
@@ -38,7 +38,7 @@ ide_autotools_makecache_stage_makecache_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(IdeMakecache) makecache = NULL;
g_autoptr(GError) error = NULL;
IdeAutotoolsMakecacheStage *self;
@@ -46,23 +46,23 @@ ide_autotools_makecache_stage_makecache_cb (GObject *object,
IDE_ENTRY;
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
makecache = ide_makecache_new_for_cache_file_finish (result, &error);
if (makecache == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
g_assert (IDE_IS_AUTOTOOLS_MAKECACHE_STAGE (self));
g_clear_object (&self->makecache);
self->makecache = g_steal_pointer (&makecache);
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
IDE_EXIT;
}
@@ -74,7 +74,7 @@ ide_autotools_makecache_stage_execute_cb (GObject *object,
{
IdeAutotoolsMakecacheStage *self = (IdeAutotoolsMakecacheStage *)object;
IdeBuildStage *stage = (IdeBuildStage *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
GCancellable *cancellable;
@@ -83,16 +83,16 @@ ide_autotools_makecache_stage_execute_cb (GObject *object,
g_assert (IDE_IS_AUTOTOOLS_MAKECACHE_STAGE (stage));
g_assert (IDE_IS_AUTOTOOLS_MAKECACHE_STAGE (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!IDE_BUILD_STAGE_CLASS (ide_autotools_makecache_stage_parent_class)->execute_finish (stage, result,
&error))
{
g_warning ("%s", error->message);
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
- cancellable = g_task_get_cancellable (task);
+ cancellable = ide_task_get_cancellable (task);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
/*
@@ -117,7 +117,7 @@ ide_autotools_makecache_stage_execute_async (IdeBuildStage *stage,
gpointer user_data)
{
IdeAutotoolsMakecacheStage *self = (IdeAutotoolsMakecacheStage *)stage;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IDE_ENTRY;
@@ -125,8 +125,8 @@ ide_autotools_makecache_stage_execute_async (IdeBuildStage *stage,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_autotools_makecache_stage_execute_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_autotools_makecache_stage_execute_async);
/*
* First we need to execute our launcher (performed by our parent class).
@@ -153,9 +153,9 @@ ide_autotools_makecache_stage_execute_finish (IdeBuildStage *stage,
IDE_ENTRY;
g_assert (IDE_IS_AUTOTOOLS_MAKECACHE_STAGE (stage));
- g_assert (G_IS_TASK (result));
+ g_assert (IDE_IS_TASK (result));
- ret = g_task_propagate_boolean (G_TASK (result), error);
+ ret = ide_task_propagate_boolean (IDE_TASK (result), error);
IDE_RETURN (ret);
}
diff --git a/src/plugins/beautifier/gb-beautifier-helper.c b/src/plugins/beautifier/gb-beautifier-helper.c
index 8064e939a..12d4583f6 100644
--- a/src/plugins/beautifier/gb-beautifier-helper.c
+++ b/src/plugins/beautifier/gb-beautifier-helper.c
@@ -147,22 +147,22 @@ gb_beautifier_helper_create_tmp_file_cb (GObject *object,
{
GFile *file = (GFile *)object;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = (GTask *)user_data;
+ g_autoptr(IdeTask) task = (IdeTask *)user_data;
g_assert (G_IS_FILE (file));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!g_file_replace_contents_finish (file, result, NULL, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
- if (g_task_return_error_if_cancelled (task))
+ if (ide_task_return_error_if_cancelled (task))
g_file_delete (file, NULL, NULL);
else
- g_task_return_pointer (task, g_object_ref (file), g_object_unref);
+ ide_task_return_pointer (task, g_object_ref (file), g_object_unref);
}
void
@@ -172,7 +172,7 @@ gb_beautifier_helper_create_tmp_file_async (GbBeautifierEditorAddin *self,
GCancellable *cancellable,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GFile) file = NULL;
g_autoptr(GBytes) bytes = NULL;
g_autofree gchar *tmp_path = NULL;
@@ -183,16 +183,16 @@ gb_beautifier_helper_create_tmp_file_async (GbBeautifierEditorAddin *self,
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
g_assert (callback != NULL);
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gb_beautifier_helper_create_tmp_file_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gb_beautifier_helper_create_tmp_file_async);
tmp_path = g_build_filename (self->tmp_dir, "XXXXXX.txt", NULL);
if (-1 == (fd = g_mkstemp (tmp_path)))
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "Failed to create temporary file for the Beautifier plugin");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Failed to create temporary file for the Beautifier plugin");
return;
}
@@ -217,10 +217,10 @@ gb_beautifier_helper_create_tmp_file_finish (GbBeautifierEditorAddin *self,
GError **error)
{
g_assert (GB_IS_BEAUTIFIER_EDITOR_ADDIN (self));
- g_assert (G_IS_TASK (result));
- g_assert (g_task_is_valid (G_TASK (result), self));
+ g_assert (IDE_IS_TASK (result));
+ g_assert (ide_task_is_valid (IDE_TASK (result), self));
- return g_task_propagate_pointer (G_TASK (result), error);
+ return ide_task_propagate_pointer (IDE_TASK (result), error);
}
gchar *
diff --git a/src/plugins/beautifier/gb-beautifier-process.c b/src/plugins/beautifier/gb-beautifier-process.c
index a9c99f9ee..309e9a6e2 100644
--- a/src/plugins/beautifier/gb-beautifier-process.c
+++ b/src/plugins/beautifier/gb-beautifier-process.c
@@ -224,7 +224,7 @@ process_communicate_utf8_cb (GObject *object,
gpointer user_data)
{
g_autoptr(GSubprocess) process = (GSubprocess *)object;
- g_autoptr(GTask) task = (GTask *)user_data;
+ g_autoptr(IdeTask) task = (IdeTask *)user_data;
g_autoptr(GBytes) stdout_gb = NULL;
g_autoptr(GBytes) stderr_gb = NULL;
const gchar *stdout_str = NULL;
@@ -238,18 +238,18 @@ process_communicate_utf8_cb (GObject *object,
g_assert (G_IS_SUBPROCESS (process));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!g_subprocess_communicate_finish (process, result, &stdout_gb, &stderr_gb, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
- if (g_task_return_error_if_cancelled (task))
+ if (ide_task_return_error_if_cancelled (task))
return;
- state = (ProcessState *)g_task_get_task_data (task);
+ state = (ProcessState *)ide_task_get_task_data (task);
if (stderr_gb != NULL &&
NULL != (stderr_str = g_bytes_get_data (stderr_gb, NULL)) &&
!dzl_str_empty0 (stderr_str) &&
@@ -293,7 +293,7 @@ process_communicate_utf8_cb (GObject *object,
gtk_text_buffer_end_user_action (buffer);
gtk_source_completion_unblock_interactive (completion);
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
else
ide_object_warning (state->self,_("Beautify plugin: the output is not a valid UTF-8 text"));
@@ -305,7 +305,7 @@ create_text_tmp_file_cb (GObject *object,
gpointer user_data)
{
GbBeautifierEditorAddin *self = (GbBeautifierEditorAddin *)object;
- g_autoptr (GTask) task = (GTask *)user_data;
+ g_autoptr (IdeTask) task = (IdeTask *)user_data;
g_autoptr(GError) error = NULL;
ProcessState *state;
GSubprocess *process;
@@ -313,9 +313,9 @@ create_text_tmp_file_cb (GObject *object,
g_assert (GB_IS_BEAUTIFIER_EDITOR_ADDIN (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- state = (ProcessState *)g_task_get_task_data (task);
+ state = (ProcessState *)ide_task_get_task_data (task);
if (NULL == (state->src_file = gb_beautifier_helper_create_tmp_file_finish (self, result, &error)))
goto fail;
@@ -326,11 +326,11 @@ create_text_tmp_file_cb (GObject *object,
if (process != NULL)
{
- if (g_task_return_error_if_cancelled (task))
+ if (ide_task_return_error_if_cancelled (task))
g_object_unref (process);
else
{
- cancellable = g_task_get_cancellable (task);
+ cancellable = ide_task_get_cancellable (task);
g_subprocess_communicate_async (process,
NULL,
cancellable,
@@ -342,7 +342,7 @@ create_text_tmp_file_cb (GObject *object,
}
fail:
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -379,7 +379,7 @@ gb_beautifier_process_launch_async (GbBeautifierEditorAddin *self,
{
GtkTextBuffer *buffer;
ProcessState *state;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
const gchar *lang_id;
g_assert (GB_IS_BEAUTIFIER_EDITOR_ADDIN (self));
@@ -417,10 +417,10 @@ gb_beautifier_process_launch_async (GbBeautifierEditorAddin *self,
if (entry->command_args != NULL)
state->command_args_strs = command_args_copy (entry->command_args);
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gb_beautifier_process_launch_async);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_task_data (task, state, process_state_free);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gb_beautifier_process_launch_async);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_task_data (task, state, process_state_free);
gb_beautifier_helper_create_tmp_file_async (self,
state->text,
@@ -435,7 +435,7 @@ gb_beautifier_process_launch_finish (GbBeautifierEditorAddin *self,
GError **error)
{
g_assert (GB_IS_BEAUTIFIER_EDITOR_ADDIN (self));
- g_assert (g_task_is_valid (result, self));
+ g_assert (ide_task_is_valid (result, self));
- return g_task_propagate_boolean (G_TASK (result), error);
+ return ide_task_propagate_boolean (IDE_TASK (result), error);
}
diff --git a/src/plugins/create-project/gbp-create-project-genesis-addin.c
b/src/plugins/create-project/gbp-create-project-genesis-addin.c
index eacc39316..8ede06909 100644
--- a/src/plugins/create-project/gbp-create-project-genesis-addin.c
+++ b/src/plugins/create-project/gbp-create-project-genesis-addin.c
@@ -164,17 +164,17 @@ gbp_create_project_genesis_addin_run_cb (GObject *object,
gpointer user_data)
{
GbpCreateProjectWidget *widget = (GbpCreateProjectWidget *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (GBP_IS_CREATE_PROJECT_WIDGET (widget));
if (!gbp_create_project_widget_create_finish (widget, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
static void
@@ -184,11 +184,11 @@ gbp_create_project_genesis_addin_run_async (IdeGenesisAddin *addin,
gpointer user_data)
{
GbpCreateProjectGenesisAddin *self = (GbpCreateProjectGenesisAddin *)addin;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_CREATE_PROJECT_GENESIS_ADDIN (self));
- task = g_task_new (self, cancellable, callback, user_data);
+ task = ide_task_new (self, cancellable, callback, user_data);
/*
* TODO: Generate the project from information found in the widget.
@@ -207,9 +207,9 @@ gbp_create_project_genesis_addin_run_finish (IdeGenesisAddin *addin,
GError **error)
{
g_return_val_if_fail (GBP_IS_CREATE_PROJECT_GENESIS_ADDIN (addin), FALSE);
- g_return_val_if_fail (G_IS_TASK (result), FALSE);
+ g_return_val_if_fail (IDE_IS_TASK (result), FALSE);
- return g_task_propagate_boolean (G_TASK (result), error);
+ return ide_task_propagate_boolean (IDE_TASK (result), error);
}
static gint
diff --git a/src/plugins/create-project/gbp-create-project-tool.c
b/src/plugins/create-project/gbp-create-project-tool.c
index 1ab1c8cc6..d69a86d8b 100644
--- a/src/plugins/create-project/gbp-create-project-tool.c
+++ b/src/plugins/create-project/gbp-create-project-tool.c
@@ -241,17 +241,17 @@ vcs_init_cb (GObject *object,
gpointer user_data)
{
IdeVcsInitializer *vcs = (IdeVcsInitializer *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_assert (IDE_IS_VCS_INITIALIZER (vcs));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (G_IS_ASYNC_RESULT (result));
if (!ide_vcs_initializer_initialize_finish (vcs, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_int (task, 0);
+ ide_task_return_int (task, 0);
}
static void
@@ -260,21 +260,21 @@ extract_cb (GObject *object,
gpointer user_data)
{
IdeProjectTemplate *template = (IdeProjectTemplate *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
GbpCreateProjectTool *self;
g_autoptr(IdeVcsInitializer) vcs = NULL;
g_autoptr(GError) error = NULL;
g_assert (IDE_IS_PROJECT_TEMPLATE (template));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
g_assert (GBP_IS_CREATE_PROJECT_TOOL (self));
if (!ide_project_template_expand_finish (template, result, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -286,13 +286,13 @@ extract_cb (GObject *object,
ide_vcs_initializer_initialize_async (vcs,
project_dir,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
vcs_init_cb,
g_object_ref (task));
return;
}
- g_task_return_int (task, 0);
+ ide_task_return_int (task, 0);
}
static gboolean
@@ -342,35 +342,35 @@ gbp_create_project_tool_run_async (IdeApplicationTool *tool,
{
GbpCreateProjectTool *self = (GbpCreateProjectTool *)tool;
IdeProjectTemplate *template;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GHashTable) params = NULL;
const gchar *name;
g_autoptr(GError) error = NULL;
g_assert (GBP_IS_CREATE_PROJECT_TOOL (self));
- task = g_task_new (self, cancellable, callback, user_data);
+ task = ide_task_new (self, cancellable, callback, user_data);
/* pretend that "create-project" is argv[0] */
self->args = g_strdupv ((gchar **)&arguments[1]);
if (!gbp_create_project_tool_parse (self, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
if (self->list_templates)
{
gbp_create_project_tool_list_templates (self);
- g_task_return_int (task, 0);
+ ide_task_return_int (task, 0);
return;
}
if (!self->args || g_strv_length (self->args) < 2)
{
g_printerr (_("Please specify a project name.\n"));
- g_task_return_int (task, 1);
+ ide_task_return_int (task, 1);
return;
}
@@ -379,7 +379,7 @@ gbp_create_project_tool_run_async (IdeApplicationTool *tool,
if (!validate_name (self, name, &error))
{
g_printerr ("%s\n", error->message);
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -387,7 +387,7 @@ gbp_create_project_tool_run_async (IdeApplicationTool *tool,
{
g_printerr (_("Please specify a project template with --template=\n"));
gbp_create_project_tool_list_templates (self);
- g_task_return_int (task, 1);
+ ide_task_return_int (task, 1);
return;
}
@@ -399,7 +399,7 @@ gbp_create_project_tool_run_async (IdeApplicationTool *tool,
if (!extract_params (self, params, &error))
{
g_printerr ("%s\n", error->message);
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -431,9 +431,9 @@ gbp_create_project_tool_run_finish (IdeApplicationTool *tool,
GError **error)
{
g_assert (GBP_IS_CREATE_PROJECT_TOOL (tool));
- g_assert (G_IS_TASK (result));
+ g_assert (IDE_IS_TASK (result));
- return g_task_propagate_int (G_TASK (result), error);
+ return ide_task_propagate_int (IDE_TASK (result), error);
}
static void
diff --git a/src/plugins/create-project/gbp-create-project-widget.c
b/src/plugins/create-project/gbp-create-project-widget.c
index 30eb86b40..3a538fc07 100644
--- a/src/plugins/create-project/gbp-create-project-widget.c
+++ b/src/plugins/create-project/gbp-create-project-widget.c
@@ -516,7 +516,7 @@ init_vcs_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
IdeVcsInitializer *vcs = (IdeVcsInitializer *)object;
GbpCreateProjectWidget *self;
IdeWorkbench *workbench;
@@ -524,24 +524,24 @@ init_vcs_cb (GObject *object,
g_autoptr(GError) error = NULL;
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!ide_vcs_initializer_initialize_finish (vcs, result, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
g_assert (GBP_IS_CREATE_PROJECT_WIDGET (self));
- project_file = g_task_get_task_data (task);
+ project_file = ide_task_get_task_data (task);
g_assert (G_IS_FILE (project_file));
workbench = ide_widget_get_workbench (GTK_WIDGET (self));
ide_workbench_open_project_async (workbench, project_file, NULL, NULL, NULL);
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
static void
@@ -550,7 +550,7 @@ extract_cb (GObject *object,
gpointer user_data)
{
IdeProjectTemplate *template = (IdeProjectTemplate *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(IdeVcsInitializer) vcs = NULL;
GbpCreateProjectWidget *self;
IdeWorkbench *workbench;
@@ -569,25 +569,25 @@ extract_cb (GObject *object,
g_assert (IDE_IS_PROJECT_TEMPLATE (template));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!ide_project_template_expand_finish (template, result, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
g_assert (GBP_IS_CREATE_PROJECT_WIDGET (self));
- project_file = g_task_get_task_data (task);
+ project_file = ide_task_get_task_data (task);
g_assert (G_IS_FILE (project_file));
if (!gtk_switch_get_active (self->versioning_switch))
{
workbench = ide_widget_get_workbench (GTK_WIDGET (self));
ide_workbench_open_project_async (workbench, project_file, NULL, NULL, NULL);
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
return;
}
@@ -604,17 +604,17 @@ extract_cb (GObject *object,
ide_vcs_initializer_initialize_async (vcs,
project_file,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
init_vcs_cb,
g_object_ref (task));
return;
failure:
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- _("A failure occurred while initializing version control"));
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ _("A failure occurred while initializing version control"));
}
void
@@ -623,7 +623,7 @@ gbp_create_project_widget_create_async (GbpCreateProjectWidget *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GHashTable) params = NULL;
g_autoptr(IdeProjectTemplate) template = NULL;
g_autoptr(IdeVcsConfig) vcs_conf = NULL;
@@ -731,8 +731,8 @@ gbp_create_project_widget_create_async (GbpCreateProjectWidget *self,
g_value_unset (&str);
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_task_data (task, g_file_new_for_path (path), g_object_unref);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_task_data (task, g_file_new_for_path (path), g_object_unref);
ide_project_template_expand_async (template,
params,
@@ -747,7 +747,7 @@ gbp_create_project_widget_create_finish (GbpCreateProjectWidget *self,
GError **error)
{
g_return_val_if_fail (GBP_IS_CREATE_PROJECT_WIDGET (self), FALSE);
- g_return_val_if_fail (G_IS_TASK (result), FALSE);
+ g_return_val_if_fail (IDE_IS_TASK (result), FALSE);
- return g_task_propagate_boolean (G_TASK (result), error);
+ return ide_task_propagate_boolean (IDE_TASK (result), error);
}
diff --git a/src/plugins/deviced/gbp-deviced-deploy-strategy.c
b/src/plugins/deviced/gbp-deviced-deploy-strategy.c
index 8cade1689..c3042df10 100644
--- a/src/plugins/deviced/gbp-deviced-deploy-strategy.c
+++ b/src/plugins/deviced/gbp-deviced-deploy-strategy.c
@@ -64,7 +64,7 @@ gbp_deviced_deploy_strategy_load_async (IdeDeployStrategy *strategy,
gpointer user_data)
{
GbpDevicedDeployStrategy *self = (GbpDevicedDeployStrategy *)strategy;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IdeConfiguration *config;
IdeDevice *device;
@@ -74,8 +74,8 @@ gbp_deviced_deploy_strategy_load_async (IdeDeployStrategy *strategy,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_deviced_deploy_strategy_load_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_deviced_deploy_strategy_load_async);
config = ide_build_pipeline_get_configuration (pipeline);
@@ -83,16 +83,16 @@ gbp_deviced_deploy_strategy_load_async (IdeDeployStrategy *strategy,
!GBP_IS_DEVICED_DEVICE (device) ||
!GBP_IS_FLATPAK_MANIFEST (config))
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- "%s is not supported by %s",
- G_OBJECT_TYPE_NAME (device),
- G_OBJECT_TYPE_NAME (self));
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "%s is not supported by %s",
+ G_OBJECT_TYPE_NAME (device),
+ G_OBJECT_TYPE_NAME (self));
IDE_EXIT;
}
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
IDE_EXIT;
}
@@ -104,18 +104,18 @@ deploy_install_bundle_cb (GObject *object,
{
GbpDevicedDevice *device = (GbpDevicedDevice *)object;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
IDE_ENTRY;
g_assert (GBP_IS_DEVICED_DEVICE (device));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!gbp_deviced_device_install_bundle_finish (device, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
IDE_EXIT;
}
@@ -139,7 +139,7 @@ deploy_wait_check_cb (GObject *object,
gpointer user_data)
{
IdeSubprocess *subprocess = (IdeSubprocess *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
DeployState *state;
@@ -147,17 +147,17 @@ deploy_wait_check_cb (GObject *object,
g_assert (IDE_IS_SUBPROCESS (subprocess));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
if (!ide_subprocess_wait_check_finish (subprocess, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
gbp_deviced_device_install_bundle_async (state->device,
state->flatpak_path,
deploy_progress_cb, state, NULL,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
deploy_install_bundle_cb,
g_object_ref (task));
@@ -171,7 +171,7 @@ deploy_get_commit_cb (GObject *object,
{
GbpDevicedDevice *device = (GbpDevicedDevice *)object;
g_autoptr(IdeSubprocessLauncher) launcher = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autofree gchar *commit_id = NULL;
g_autofree gchar *dest_path = NULL;
g_autofree gchar *name = NULL;
@@ -190,9 +190,9 @@ deploy_get_commit_cb (GObject *object,
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_DEVICED_DEVICE (device));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
g_assert (state != NULL);
g_assert (IDE_IS_BUILD_PIPELINE (state->pipeline));
@@ -243,10 +243,10 @@ deploy_get_commit_cb (GObject *object,
ide_build_pipeline_attach_pty (state->pipeline, launcher);
if (!(subprocess = ide_subprocess_launcher_spawn (launcher, NULL, &error)))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
ide_subprocess_wait_check_async (subprocess,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
deploy_wait_check_cb,
g_object_ref (task));
@@ -260,7 +260,7 @@ deploy_commit_cb (GObject *object,
{
IdeBuildPipeline *pipeline = (IdeBuildPipeline *)object;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
GCancellable *cancellable;
DeployState *state;
@@ -268,7 +268,7 @@ deploy_commit_cb (GObject *object,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
/*
* If we successfully exported the build to a repo, we can now check
@@ -276,11 +276,11 @@ deploy_commit_cb (GObject *object,
* some data transfer by building a static-delta.
*/
- cancellable = g_task_get_cancellable (task);
- state = g_task_get_task_data (task);
+ cancellable = ide_task_get_cancellable (task);
+ state = ide_task_get_task_data (task);
if (!ide_build_pipeline_build_finish (pipeline, result, &error))
- g_task_return_error (task, g_steal_pointer (&task));
+ ide_task_return_error (task, g_steal_pointer (&task));
else
gbp_deviced_device_get_commit_async (state->device,
state->app_id,
@@ -302,7 +302,7 @@ gbp_deviced_deploy_strategy_deploy_async (IdeDeployStrategy *strategy,
gpointer user_data)
{
GbpDevicedDeployStrategy *self = (GbpDevicedDeployStrategy *)strategy;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IdeConfiguration *config;
DeployState *state;
const gchar *app_id;
@@ -315,8 +315,8 @@ gbp_deviced_deploy_strategy_deploy_async (IdeDeployStrategy *strategy,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_deviced_deploy_strategy_deploy_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_deviced_deploy_strategy_deploy_async);
config = ide_build_pipeline_get_configuration (pipeline);
device = ide_build_pipeline_get_device (pipeline);
@@ -333,7 +333,7 @@ gbp_deviced_deploy_strategy_deploy_async (IdeDeployStrategy *strategy,
state->progress = progress;
state->progress_data = progress_data;
state->progress_data_destroy = progress_data_destroy;
- g_task_set_task_data (task, state, (GDestroyNotify)deploy_state_free);
+ ide_task_set_task_data (task, state, (GDestroyNotify)deploy_state_free);
/*
* First make sure we've built up to the point where we have a
diff --git a/src/plugins/deviced/gbp-deviced-device-provider.c
b/src/plugins/deviced/gbp-deviced-device-provider.c
index 4fe080136..a0aab5a11 100644
--- a/src/plugins/deviced/gbp-deviced-device-provider.c
+++ b/src/plugins/deviced/gbp-deviced-device-provider.c
@@ -90,18 +90,18 @@ gbp_deviced_device_provider_load_cb (GObject *object,
{
DevdBrowser *browser = (DevdBrowser *)object;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
IDE_ENTRY;
g_assert (DEVD_IS_BROWSER (browser));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!devd_browser_load_finish (browser, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
IDE_EXIT;
}
@@ -113,15 +113,15 @@ gbp_deviced_device_provider_load_async (IdeDeviceProvider *provider,
gpointer user_data)
{
GbpDevicedDeviceProvider *self = (GbpDevicedDeviceProvider *)provider;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IDE_ENTRY;
g_assert (GBP_IS_DEVICED_DEVICE_PROVIDER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_deviced_device_provider_load_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_deviced_device_provider_load_async);
devd_browser_load_async (self->browser,
cancellable,
@@ -141,9 +141,9 @@ gbp_deviced_device_provider_load_finish (IdeDeviceProvider *provider,
IDE_ENTRY;
g_assert (GBP_IS_DEVICED_DEVICE_PROVIDER (provider));
- g_assert (G_IS_TASK (result));
+ g_assert (IDE_IS_TASK (result));
- ret = g_task_propagate_boolean (G_TASK (result), error);
+ ret = ide_task_propagate_boolean (IDE_TASK (result), error);
IDE_RETURN (ret);
}
diff --git a/src/plugins/deviced/gbp-deviced-device.c b/src/plugins/deviced/gbp-deviced-device.c
index add2ffd96..cc6fd09d7 100644
--- a/src/plugins/deviced/gbp-deviced-device.c
+++ b/src/plugins/deviced/gbp-deviced-device.c
@@ -83,16 +83,16 @@ gbp_deviced_device_connect_cb (GObject *object,
for (const GList *iter = list; iter != NULL; iter = iter->next)
{
- g_autoptr(GTask) task = iter->data;
- g_task_return_error (task, g_error_copy (error));
+ g_autoptr(IdeTask) task = iter->data;
+ ide_task_return_error (task, g_error_copy (error));
}
}
else
{
for (const GList *iter = list; iter != NULL; iter = iter->next)
{
- g_autoptr(GTask) task = iter->data;
- g_task_return_pointer (task, g_object_ref (client), g_object_unref);
+ g_autoptr(IdeTask) task = iter->data;
+ ide_task_return_pointer (task, g_object_ref (client), g_object_unref);
}
}
@@ -105,17 +105,17 @@ gbp_deviced_device_get_client_async (GbpDevicedDevice *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_DEVICED_DEVICE (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_deviced_device_get_client_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_deviced_device_get_client_async);
if (self->client != NULL && self->connecting.length == 0)
{
- g_task_return_pointer (task, g_object_ref (self->client), g_object_unref);
+ ide_task_return_pointer (task, g_object_ref (self->client), g_object_unref);
return;
}
@@ -137,9 +137,9 @@ gbp_deviced_device_get_client_finish (GbpDevicedDevice *self,
GError **error)
{
g_assert (GBP_IS_DEVICED_DEVICE (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);
}
static void
@@ -150,7 +150,7 @@ gbp_deviced_device_get_info_connect_cb (GObject *object,
GbpDevicedDevice *self = (GbpDevicedDevice *)object;
g_autoptr(IdeDeviceInfo) info = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autofree gchar *arch = NULL;
g_autofree gchar *kernel = NULL;
g_autofree gchar *system = NULL;
@@ -158,11 +158,11 @@ gbp_deviced_device_get_info_connect_cb (GObject *object,
g_assert (GBP_IS_DEVICED_DEVICE (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!(client = gbp_deviced_device_get_client_finish (self, result, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -176,7 +176,7 @@ gbp_deviced_device_get_info_connect_cb (GObject *object,
"system", system,
NULL);
- g_task_return_pointer (task, g_steal_pointer (&info), g_object_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&info), g_object_unref);
}
static void
@@ -186,13 +186,13 @@ gbp_deviced_device_get_info_async (IdeDevice *device,
gpointer user_data)
{
GbpDevicedDevice *self = (GbpDevicedDevice *)device;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_DEVICED_DEVICE (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_deviced_device_get_info_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_deviced_device_get_info_async);
gbp_deviced_device_get_client_async (self,
cancellable,
@@ -206,9 +206,9 @@ gbp_deviced_device_get_info_finish (IdeDevice *device,
GError **error)
{
g_assert (IDE_IS_DEVICE (device));
- 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);
}
static void
@@ -324,22 +324,22 @@ gbp_deviced_device_get_commit_list_apps_cb (GObject *object,
DevdClient *client = (DevdClient *)object;
g_autoptr(GPtrArray) apps = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
const gchar *app_id;
IDE_ENTRY;
g_assert (DEVD_IS_CLIENT (client));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!(apps = devd_client_list_apps_finish (client, result, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
- app_id = g_task_get_task_data (task);
+ app_id = ide_task_get_task_data (task);
for (guint i = 0; i < apps->len; i++)
{
@@ -351,17 +351,17 @@ gbp_deviced_device_get_commit_list_apps_cb (GObject *object,
if (commit_id != NULL)
{
- g_task_return_pointer (task, g_strdup (commit_id), g_free);
+ ide_task_return_pointer (task, g_strdup (commit_id), g_free);
IDE_EXIT;
}
}
}
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_FOUND,
- "No such application \"%s\"",
- app_id);
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_FOUND,
+ "No such application \"%s\"",
+ app_id);
IDE_EXIT;
}
@@ -374,22 +374,22 @@ gbp_deviced_device_get_commit_client_cb (GObject *object,
GbpDevicedDevice *self = (GbpDevicedDevice *)object;
g_autoptr(DevdClient) client = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
GCancellable *cancellable;
IDE_ENTRY;
g_assert (GBP_IS_DEVICED_DEVICE (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!(client = gbp_deviced_device_get_client_finish (self, result, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
- cancellable = g_task_get_cancellable (task);
+ cancellable = ide_task_get_cancellable (task);
devd_client_list_apps_async (client,
cancellable,
@@ -406,7 +406,7 @@ gbp_deviced_device_get_commit_async (GbpDevicedDevice *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IDE_ENTRY;
@@ -414,9 +414,9 @@ gbp_deviced_device_get_commit_async (GbpDevicedDevice *self,
g_return_if_fail (app_id != NULL);
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_deviced_device_get_commit_async);
- g_task_set_task_data (task, g_strdup (app_id), g_free);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_deviced_device_get_commit_async);
+ ide_task_set_task_data (task, g_strdup (app_id), g_free);
gbp_deviced_device_get_client_async (self,
cancellable,
@@ -436,9 +436,9 @@ gbp_deviced_device_get_commit_finish (GbpDevicedDevice *self,
IDE_ENTRY;
g_return_val_if_fail (GBP_IS_DEVICED_DEVICE (self), NULL);
- g_return_val_if_fail (G_IS_TASK (result), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (result), NULL);
- ret = g_task_propagate_pointer (G_TASK (result), error);
+ ret = ide_task_propagate_pointer (IDE_TASK (result), error);
IDE_RETURN (ret);
}
@@ -463,18 +463,18 @@ install_bundle_install_cb (GObject *object,
{
DevdFlatpakService *service = (DevdFlatpakService *)object;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
IDE_ENTRY;
g_assert (DEVD_IS_FLATPAK_SERVICE (service));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!devd_flatpak_service_install_bundle_finish (service, result, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
/* TODO: Remove bundle */
@@ -490,7 +490,7 @@ install_bundle_put_file_cb (GObject *object,
DevdTransferService *service = (DevdTransferService *)object;
g_autoptr(DevdFlatpakService) flatpak = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
InstallBundleState *state;
DevdClient *client;
@@ -498,11 +498,11 @@ install_bundle_put_file_cb (GObject *object,
g_assert (DEVD_IS_TRANSFER_SERVICE (service));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!devd_transfer_service_put_file_finish (service, result, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -510,17 +510,17 @@ install_bundle_put_file_cb (GObject *object,
if (!(flatpak = devd_flatpak_service_new (client, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
g_assert (state != NULL);
g_assert (state->remote_path != NULL);
devd_flatpak_service_install_bundle_async (flatpak,
state->remote_path,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
install_bundle_install_cb,
g_object_ref (task));
@@ -536,7 +536,7 @@ install_bundle_get_client_cb (GObject *object,
g_autoptr(DevdTransferService) service = NULL;
g_autoptr(DevdClient) client = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GFile) file = NULL;
InstallBundleState *state;
@@ -544,21 +544,21 @@ install_bundle_get_client_cb (GObject *object,
g_assert (GBP_IS_DEVICED_DEVICE (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
g_assert (state != NULL);
g_assert (state->local_path != NULL);
if (!(client = gbp_deviced_device_get_client_finish (self, result, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
if (!(service = devd_transfer_service_new (client, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -568,7 +568,7 @@ install_bundle_get_client_cb (GObject *object,
file,
state->remote_path,
install_bundle_progress, state, NULL,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
install_bundle_put_file_cb,
g_object_ref (task));
@@ -585,7 +585,7 @@ gbp_deviced_device_install_bundle_async (GbpDevicedDevice *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *name = NULL;
InstallBundleState *state;
@@ -595,8 +595,8 @@ gbp_deviced_device_install_bundle_async (GbpDevicedDevice *self,
g_return_if_fail (bundle_path != NULL);
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_deviced_device_install_bundle_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_deviced_device_install_bundle_async);
name = g_path_get_basename (bundle_path);
@@ -606,7 +606,7 @@ gbp_deviced_device_install_bundle_async (GbpDevicedDevice *self,
state->progress = progress;
state->progress_data = progress_data;
state->progress_data_destroy = progress_data_destroy;
- g_task_set_task_data (task, state, (GDestroyNotify)install_bundle_state_free);
+ ide_task_set_task_data (task, state, (GDestroyNotify)install_bundle_state_free);
gbp_deviced_device_get_client_async (self,
cancellable,
@@ -626,9 +626,9 @@ gbp_deviced_device_install_bundle_finish (GbpDevicedDevice *self,
IDE_ENTRY;
g_return_val_if_fail (GBP_IS_DEVICED_DEVICE (self), FALSE);
- g_return_val_if_fail (G_IS_TASK (result), FALSE);
+ g_return_val_if_fail (IDE_IS_TASK (result), FALSE);
- ret = g_task_propagate_boolean (G_TASK (result), error);
+ ret = ide_task_propagate_boolean (IDE_TASK (result), error);
IDE_RETURN (ret);
}
diff --git a/src/plugins/file-search/gb-file-search-provider.c
b/src/plugins/file-search/gb-file-search-provider.c
index 9ff84561d..15059c0ef 100644
--- a/src/plugins/file-search/gb-file-search-provider.c
+++ b/src/plugins/file-search/gb-file-search-provider.c
@@ -46,23 +46,23 @@ gb_file_search_provider_search_async (IdeSearchProvider *provider,
gpointer user_data)
{
GbFileSearchProvider *self = (GbFileSearchProvider *)provider;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GPtrArray) results = NULL;
g_assert (GB_IS_FILE_SEARCH_PROVIDER (self));
g_assert (search_terms != NULL);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gb_file_search_provider_search_async);
- g_task_set_priority (task, G_PRIORITY_LOW);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gb_file_search_provider_search_async);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
if (self->index != NULL)
results = gb_file_search_index_populate (self->index, search_terms, max_results);
else
results = g_ptr_array_new_with_free_func (g_object_unref);
- g_task_return_pointer (task, g_steal_pointer (&results), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&results), (GDestroyNotify)g_ptr_array_unref);
}
static GPtrArray *
@@ -71,9 +71,9 @@ gb_file_search_provider_search_finish (IdeSearchProvider *provider,
GError **error)
{
g_assert (GB_IS_FILE_SEARCH_PROVIDER (provider));
- 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);
}
static void
diff --git a/src/plugins/gdb/gbp-gdb-debugger.c b/src/plugins/gdb/gbp-gdb-debugger.c
index 71cc865c5..38b8dd219 100644
--- a/src/plugins/gdb/gbp-gdb-debugger.c
+++ b/src/plugins/gdb/gbp-gdb-debugger.c
@@ -147,12 +147,12 @@ gbp_gdb_debugger_panic (GbpGdbDebugger *self)
for (const GList *iter = list; iter != NULL; iter = iter->next)
{
- g_autoptr(GTask) task = iter->data;
+ g_autoptr(IdeTask) task = iter->data;
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "There was a communication failure");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "There was a communication failure");
}
g_list_free (list);
@@ -185,7 +185,7 @@ gbp_gdb_debugger_unwrap (const struct gdbwire_mi_output *output,
return FALSE;
}
-static GTask *
+static IdeTask *
gbp_gdb_debugger_find_task (GbpGdbDebugger *self,
struct gdbwire_mi_output *output)
{
@@ -209,8 +209,8 @@ gbp_gdb_debugger_find_task (GbpGdbDebugger *self,
for (GList *iter = self->cmdqueue.head; iter; iter = iter->next)
{
- GTask *task = iter->data;
- const gchar *task_id = g_task_get_task_data (task);
+ IdeTask *task = iter->data;
+ const gchar *task_id = ide_task_get_task_data (task);
if (strcmp (id, task_id) == 0)
{
@@ -258,7 +258,7 @@ static void
gbp_gdb_debugger_handle_result (GbpGdbDebugger *self,
struct gdbwire_mi_output *output)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (output->kind == GDBWIRE_MI_OUTPUT_RESULT);
@@ -268,7 +268,7 @@ gbp_gdb_debugger_handle_result (GbpGdbDebugger *self,
if (task != NULL)
{
- g_task_return_pointer (task, output, (GDestroyNotify)gdbwire_mi_output_free);
+ ide_task_return_pointer (task, output, (GDestroyNotify)gdbwire_mi_output_free);
return;
}
@@ -939,7 +939,7 @@ gbp_gdb_debugger_list_breakpoints_cb (GObject *object,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GPtrArray) ar = NULL;
g_autoptr(GError) error = NULL;
struct gdbwire_mi_command *command = NULL;
@@ -948,13 +948,13 @@ gbp_gdb_debugger_list_breakpoints_cb (GObject *object,
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -965,10 +965,10 @@ gbp_gdb_debugger_list_breakpoints_cb (GObject *object,
if (res != GDBWIRE_OK)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_INVAL,
- "Invalid reply from gdb");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_INVAL,
+ "Invalid reply from gdb");
return;
}
@@ -1030,7 +1030,7 @@ gbp_gdb_debugger_list_breakpoints_cb (GObject *object,
}
}
- g_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
gdbwire_mi_command_free (command);
gdbwire_mi_output_free (output);
@@ -1116,14 +1116,14 @@ gbp_gdb_debugger_list_breakpoints_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_list_breakpoints_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_list_breakpoints_async);
gbp_gdb_debugger_exec_async (self,
NULL,
@@ -1139,9 +1139,9 @@ gbp_gdb_debugger_list_breakpoints_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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);
}
static void
@@ -1150,19 +1150,19 @@ gbp_gdb_debugger_insert_breakpoint_cb (GObject *object,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
struct gdbwire_mi_output *output;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
g_clear_pointer (&output, gdbwire_mi_output_free);
return;
}
@@ -1175,14 +1175,14 @@ gbp_gdb_debugger_insert_breakpoint_cb (GObject *object,
output,
output->variant.result_record->result,
GDBWIRE_MI_ASYNC_BREAKPOINT_CREATED);
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
else
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "Failed to decode breakpoint reply");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Failed to decode breakpoint reply");
}
gdbwire_mi_output_free (output);
@@ -1198,7 +1198,7 @@ gbp_gdb_debugger_insert_breakpoint_async (IdeDebugger *debugger,
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
g_autofree gchar *translated_file = NULL;
g_autoptr(GString) command = NULL;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GFile) gfile = NULL;
IdeDebuggerAddress addr;
const gchar *func;
@@ -1211,10 +1211,10 @@ gbp_gdb_debugger_insert_breakpoint_async (IdeDebugger *debugger,
g_assert (IDE_IS_DEBUGGER_BREAKPOINT (breakpoint));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_insert_breakpoint_async);
- g_task_set_return_on_cancel (task, TRUE);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_insert_breakpoint_async);
+ ide_task_set_return_on_cancel (task, TRUE);
command = g_string_new ("-break-insert");
@@ -1253,10 +1253,10 @@ gbp_gdb_debugger_insert_breakpoint_async (IdeDebugger *debugger,
}
else
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "Failed to create breakpoint based on request");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Failed to create breakpoint based on request");
return;
}
@@ -1280,9 +1280,9 @@ gbp_gdb_debugger_insert_breakpoint_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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
@@ -1291,21 +1291,21 @@ gbp_gdb_debugger_remove_breakpoint_cb (GObject *object,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
struct gdbwire_mi_output *output;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
{
- const gchar *id = g_task_get_task_data (task);
+ const gchar *id = ide_task_get_task_data (task);
g_autoptr(IdeDebuggerBreakpoint) breakpoint = NULL;
g_assert (id != NULL);
@@ -1313,7 +1313,7 @@ gbp_gdb_debugger_remove_breakpoint_cb (GObject *object,
breakpoint = ide_debugger_breakpoint_new (id);
ide_debugger_emit_breakpoint_removed (IDE_DEBUGGER (self), breakpoint);
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
g_clear_pointer (&output, gdbwire_mi_output_free);
@@ -1327,7 +1327,7 @@ gbp_gdb_debugger_remove_breakpoint_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *command = NULL;
const gchar *id;
@@ -1337,18 +1337,18 @@ gbp_gdb_debugger_remove_breakpoint_async (IdeDebugger *debugger,
id = ide_debugger_breakpoint_get_id (breakpoint);
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_remove_breakpoint_async);
- g_task_set_task_data (task, g_strdup (id), g_free);
- g_task_set_return_on_cancel (task, TRUE);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_remove_breakpoint_async);
+ ide_task_set_task_data (task, g_strdup (id), g_free);
+ ide_task_set_return_on_cancel (task, TRUE);
if (id == NULL)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_INVAL,
- "Invalid breakpoint identifier");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_INVAL,
+ "Invalid breakpoint identifier");
return;
}
@@ -1368,9 +1368,9 @@ gbp_gdb_debugger_remove_breakpoint_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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
@@ -1406,19 +1406,19 @@ gbp_gdb_debugger_move_cb (GObject *object,
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
struct gdbwire_mi_output *output;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
g_clear_pointer (&output, gdbwire_mi_output_free);
}
@@ -1431,16 +1431,16 @@ gbp_gdb_debugger_move_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
const gchar *command = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (IDE_IS_DEBUGGER_MOVEMENT (movement));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_move_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_move_async);
switch (movement)
{
@@ -1494,9 +1494,9 @@ gbp_gdb_debugger_move_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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
@@ -1505,20 +1505,20 @@ gbp_gdb_debugger_list_frames_cb (GObject *object,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_autoptr(GPtrArray) ar = NULL;
struct gdbwire_mi_output *output;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
goto cleanup;
}
@@ -1593,7 +1593,7 @@ gbp_gdb_debugger_list_frames_cb (GObject *object,
}
}
- g_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
cleanup:
g_clear_pointer (&output, gdbwire_mi_output_free);
@@ -1607,15 +1607,15 @@ gbp_gdb_debugger_list_frames_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (IDE_DEBUGGER_THREAD (thread));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_list_frames_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_list_frames_async);
/* TODO: We are expected to be stopped here, but we should also make sure
* the appropriate thread is selected first.
@@ -1635,9 +1635,9 @@ gbp_gdb_debugger_list_frames_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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);
}
static void
@@ -1647,19 +1647,19 @@ gbp_gdb_debugger_interrupt_cb (GObject *object,
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
struct gdbwire_mi_output *output;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
g_clear_pointer (&output, gdbwire_mi_output_free);
}
@@ -1672,15 +1672,15 @@ gbp_gdb_debugger_interrupt_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (!thread_group || IDE_IS_DEBUGGER_THREAD_GROUP (thread_group));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_interrupt_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_interrupt_async);
gbp_gdb_debugger_exec_async (self,
NULL,
@@ -1696,9 +1696,9 @@ gbp_gdb_debugger_interrupt_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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
@@ -1708,12 +1708,12 @@ gbp_gdb_debugger_send_signal_cb (GObject *object,
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
struct gdbwire_mi_output *output;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
@@ -1722,9 +1722,9 @@ gbp_gdb_debugger_send_signal_cb (GObject *object,
*/
if (error != NULL || gbp_gdb_debugger_unwrap (output, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
g_clear_pointer (&output, gdbwire_mi_output_free);
}
@@ -1738,15 +1738,15 @@ gbp_gdb_debugger_send_signal_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *command = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_send_signal_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_send_signal_async);
command = g_strdup_printf ("signal %d", signum);
@@ -1764,9 +1764,9 @@ gbp_gdb_debugger_send_signal_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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
@@ -1776,19 +1776,19 @@ gbp_gdb_debugger_modify_breakpoint_cb (GObject *object,
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
struct gdbwire_mi_output *output;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
gbp_gdb_debugger_reload_breakpoints (self);
@@ -1804,7 +1804,7 @@ gbp_gdb_debugger_modify_breakpoint_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *command = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
@@ -1812,9 +1812,9 @@ gbp_gdb_debugger_modify_breakpoint_async (IdeDebugger *debugger,
g_assert (IDE_IS_DEBUGGER_BREAKPOINT (breakpoint));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_gdb_debugger_modify_breakpoint_async);
- g_task_set_priority (task, G_PRIORITY_LOW);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_modify_breakpoint_async);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
switch (change)
{
@@ -1833,10 +1833,10 @@ gbp_gdb_debugger_modify_breakpoint_async (IdeDebugger *debugger,
if (command == NULL)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- "Unsupported change requested");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "Unsupported change requested");
return;
}
@@ -1854,9 +1854,9 @@ gbp_gdb_debugger_modify_breakpoint_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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
@@ -1867,19 +1867,19 @@ gbp_gdb_debugger_list_locals_cb (GObject *object,
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
g_autoptr(GError) error = NULL;
g_autoptr(GPtrArray) ar = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
struct gdbwire_mi_output *output;
struct gdbwire_mi_result *res;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
goto cleanup;
}
@@ -1933,7 +1933,7 @@ gbp_gdb_debugger_list_locals_cb (GObject *object,
}
}
- g_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
cleanup:
g_clear_pointer (&output, gdbwire_mi_output_free);
@@ -1948,7 +1948,7 @@ gbp_gdb_debugger_list_locals_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *command = NULL;
guint depth;
@@ -1957,9 +1957,9 @@ gbp_gdb_debugger_list_locals_async (IdeDebugger *debugger,
g_assert (IDE_IS_DEBUGGER_FRAME (frame));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_list_locals_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_list_locals_async);
depth = ide_debugger_frame_get_depth (frame);
command = g_strdup_printf ("9999-stack-select-frame %u\n"
@@ -1981,9 +1981,9 @@ gbp_gdb_debugger_list_locals_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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);
}
static void
@@ -1992,7 +1992,7 @@ gbp_gdb_debugger_list_params_cb (GObject *object,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GPtrArray) ar = NULL;
g_autoptr(GError) error = NULL;
struct gdbwire_mi_output *output;
@@ -2000,13 +2000,13 @@ gbp_gdb_debugger_list_params_cb (GObject *object,
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
goto cleanup;
}
@@ -2061,7 +2061,7 @@ gbp_gdb_debugger_list_params_cb (GObject *object,
}
}
- g_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
cleanup:
g_clear_pointer (&output, gdbwire_mi_output_free);
@@ -2076,7 +2076,7 @@ gbp_gdb_debugger_list_params_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *command = NULL;
guint depth;
@@ -2085,9 +2085,9 @@ gbp_gdb_debugger_list_params_async (IdeDebugger *debugger,
g_assert (IDE_IS_DEBUGGER_FRAME (frame));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_list_params_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_list_params_async);
depth = ide_debugger_frame_get_depth (frame);
command = g_strdup_printf ("-stack-list-arguments --simple-values %u %u", depth, depth);
@@ -2106,9 +2106,9 @@ gbp_gdb_debugger_list_params_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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);
}
static void
@@ -2119,19 +2119,19 @@ gbp_gdb_debugger_list_registers_cb (GObject *object,
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
g_autoptr(GPtrArray) ar = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
struct gdbwire_mi_output *output;
struct gdbwire_mi_result *res;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
goto cleanup;
}
@@ -2177,7 +2177,7 @@ gbp_gdb_debugger_list_registers_cb (GObject *object,
}
}
- g_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
cleanup:
g_clear_pointer (&output, gdbwire_mi_output_free);
@@ -2190,14 +2190,14 @@ gbp_gdb_debugger_list_registers_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_list_registers_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_list_registers_async);
gbp_gdb_debugger_exec_async (self,
NULL,
@@ -2213,9 +2213,9 @@ gbp_gdb_debugger_list_registers_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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);
}
static void
@@ -2224,20 +2224,20 @@ gbp_gdb_debugger_disassemble_cb (GObject *object,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_autoptr(GPtrArray) ar = NULL;
struct gdbwire_mi_output *output;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (result));
+ g_assert (IDE_IS_TASK (result));
output = gbp_gdb_debugger_exec_finish (self, result, &error);
if (output == NULL || gbp_gdb_debugger_unwrap (output, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
goto cleanup;
}
@@ -2285,7 +2285,7 @@ gbp_gdb_debugger_disassemble_cb (GObject *object,
}
}
- g_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ar), (GDestroyNotify)g_ptr_array_unref);
cleanup:
g_clear_pointer (&output, gdbwire_mi_output_free);
@@ -2299,16 +2299,16 @@ gbp_gdb_debugger_disassemble_async (IdeDebugger *debugger,
gpointer user_data)
{
GbpGdbDebugger *self = (GbpGdbDebugger *)debugger;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *command = NULL;
g_assert (GBP_IS_GDB_DEBUGGER (self));
g_assert (range != NULL);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_disassemble_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_disassemble_async);
command = g_strdup_printf ("-data-disassemble "
"-s 0x%"G_GINT64_MODIFIER"x "
@@ -2329,9 +2329,9 @@ gbp_gdb_debugger_disassemble_finish (IdeDebugger *debugger,
GError **error)
{
g_assert (GBP_IS_GDB_DEBUGGER (debugger));
- 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);
}
static gboolean
@@ -2440,12 +2440,12 @@ gbp_gdb_debugger_dispose (GObject *object)
for (const GList *iter = list; iter != NULL; iter = iter->next)
{
- g_autoptr(GTask) task = iter->data;
+ g_autoptr(IdeTask) task = iter->data;
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_CANCELLED,
- "The task was canceled");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ "The task was canceled");
}
if (!g_cancellable_is_cancelled (self->read_cancellable))
@@ -2735,7 +2735,7 @@ gbp_gdb_debugger_exec_async (GbpGdbDebugger *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GBytes) bytes = NULL;
IdeDebuggerThread *selected;
@@ -2753,14 +2753,14 @@ gbp_gdb_debugger_exec_async (GbpGdbDebugger *self,
if (id == 9999)
id = self->cmdseq = 1;
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_source_tag (task, gbp_gdb_debugger_exec_async);
- g_task_set_task_data (task, g_strdup_printf ("%03u", id), g_free);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_source_tag (task, gbp_gdb_debugger_exec_async);
+ ide_task_set_task_data (task, g_strdup_printf ("%03u", id), g_free);
if (!gbp_gdb_debugger_check_ready (self, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -2813,7 +2813,7 @@ gbp_gdb_debugger_exec_async (GbpGdbDebugger *self,
* synthesize a NULL response.
*/
g_string_append_printf (str, "%s\n", command);
- g_task_return_pointer (task, NULL, NULL);
+ ide_task_return_pointer (task, NULL, NULL);
}
#if 0
@@ -2852,7 +2852,7 @@ gbp_gdb_debugger_exec_finish (GbpGdbDebugger *self,
GError **error)
{
g_return_val_if_fail (GBP_IS_GDB_DEBUGGER (self), NULL);
- g_return_val_if_fail (G_IS_TASK (result), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (result), NULL);
- return g_task_propagate_pointer (G_TASK (result), error);
+ return ide_task_propagate_pointer (IDE_TASK (result), error);
}
diff --git a/src/plugins/gettext/ide-gettext-diagnostic-provider.c
b/src/plugins/gettext/ide-gettext-diagnostic-provider.c
index 6fa75db20..1a4ad7b4c 100644
--- a/src/plugins/gettext/ide-gettext-diagnostic-provider.c
+++ b/src/plugins/gettext/ide-gettext-diagnostic-provider.c
@@ -72,7 +72,7 @@ ide_gettext_diagnostic_provider_communicate_cb (GObject *object,
gpointer user_data)
{
IdeSubprocess *subprocess = (IdeSubprocess *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(IdeDiagnostics) ret = NULL;
g_autoptr(GError) error = NULL;
g_autofree gchar *stderr_buf = NULL;
@@ -84,15 +84,15 @@ ide_gettext_diagnostic_provider_communicate_cb (GObject *object,
g_assert (IDE_IS_SUBPROCESS (subprocess));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!ide_subprocess_communicate_utf8_finish (subprocess, result, &stdout_buf, &stderr_buf, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
- file = g_task_get_task_data (task);
+ file = ide_task_get_task_data (task);
g_assert (file != NULL);
g_assert (IDE_IS_FILE (file));
@@ -135,9 +135,9 @@ ide_gettext_diagnostic_provider_communicate_cb (GObject *object,
ide_diagnostics_add (ret, diag);
}
- g_task_return_pointer (task,
- g_steal_pointer (&ret),
- (GDestroyNotify)ide_diagnostics_unref);
+ ide_task_return_pointer (task,
+ g_steal_pointer (&ret),
+ (GDestroyNotify)ide_diagnostics_unref);
}
static void
@@ -152,7 +152,7 @@ ide_gettext_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
g_autoptr(IdeSubprocessLauncher) launcher = NULL;
g_autoptr(IdeSubprocess) subprocess = NULL;
g_autoptr(GBytes) contents = NULL;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GError) error = NULL;
GtkSourceLanguage *language;
const gchar *lang_id = NULL;
@@ -163,30 +163,30 @@ ide_gettext_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
g_assert (IDE_IS_BUFFER (buffer));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_gettext_diagnostic_provider_diagnose_async);
- g_task_set_priority (task, G_PRIORITY_LOW);
- g_task_set_task_data (task, g_object_ref (file), g_object_unref);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_gettext_diagnostic_provider_diagnose_async);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
+ ide_task_set_task_data (task, g_object_ref (file), g_object_unref);
/* Figure out what language xgettext should use */
if (!(language = gtk_source_buffer_get_language (GTK_SOURCE_BUFFER (buffer))) ||
!(lang_id = gtk_source_language_get_id (language)) ||
!(xgettext_id = id_to_xgettext_language (lang_id)))
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- "Language %s is not supported",
- lang_id ?: "plain-text");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "Language %s is not supported",
+ lang_id ?: "plain-text");
return;
}
/* Return an empty set if we failed to locate any buffer contents */
if (!(contents = ide_buffer_get_content (buffer)) || g_bytes_get_size (contents) == 0)
{
- g_task_return_pointer (task,
- ide_diagnostics_new (NULL),
- (GDestroyNotify)ide_diagnostics_unref);
+ ide_task_return_pointer (task,
+ ide_diagnostics_new (NULL),
+ (GDestroyNotify)ide_diagnostics_unref);
return;
}
@@ -210,7 +210,7 @@ ide_gettext_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
/* Spawn the process of fail immediately */
if (!(subprocess = ide_subprocess_launcher_spawn (launcher, cancellable, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -230,10 +230,10 @@ ide_gettext_diagnostic_provider_diagnose_finish (IdeDiagnosticProvider *provide
GError **error)
{
g_assert (IDE_IS_GETTEXT_DIAGNOSTIC_PROVIDER (provider));
- g_assert (G_IS_TASK (result));
- g_assert (g_task_is_valid (G_TASK (result), provider));
+ g_assert (IDE_IS_TASK (result));
+ g_assert (ide_task_is_valid (IDE_TASK (result), provider));
- return g_task_propagate_pointer (G_TASK (result), error);
+ return ide_task_propagate_pointer (IDE_TASK (result), error);
}
static void
diff --git a/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
b/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
index 399b34a2b..755db1394 100644
--- a/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
+++ b/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
@@ -34,7 +34,7 @@ struct _IdeGcaDiagnosticProvider
typedef struct
{
- GTask *task; /* Integrity check backpointer */
+ IdeTask *task; /* Integrity check backpointer */
IdeUnsavedFile *unsaved_file;
IdeFile *file;
gchar *language_id;
@@ -179,7 +179,7 @@ diagnostics_cb (GObject *object,
gpointer user_data)
{
GcaDiagnostics *proxy = (GcaDiagnostics *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GVariant) var = NULL;
g_autoptr(GError) error = NULL;
IdeDiagnostics *diagnostics;
@@ -187,23 +187,23 @@ diagnostics_cb (GObject *object,
IDE_ENTRY;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (G_IS_ASYNC_RESULT (result));
if (!gca_diagnostics_call_diagnostics_finish (proxy, &var, result, &error))
{
IDE_TRACE_MSG ("%s", error->message);
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
g_assert (state->task == task);
diagnostics = variant_to_diagnostics (state, var);
- g_task_return_pointer (task, diagnostics,
- (GDestroyNotify)ide_diagnostics_unref);
+ ide_task_return_pointer (task, diagnostics,
+ (GDestroyNotify)ide_diagnostics_unref);
IDE_EXIT;
}
@@ -213,7 +213,7 @@ get_diag_proxy_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
IdeGcaDiagnosticProvider *self;
GcaDiagnostics *proxy;
@@ -221,16 +221,16 @@ get_diag_proxy_cb (GObject *object,
IDE_ENTRY;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (G_IS_ASYNC_RESULT (result));
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
proxy = gca_diagnostics_proxy_new_finish (result, &error);
if (!proxy)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -238,7 +238,7 @@ get_diag_proxy_cb (GObject *object,
g_hash_table_replace (self->document_cache, g_strdup (path), proxy);
gca_diagnostics_call_diagnostics (proxy,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
diagnostics_cb,
g_object_ref (task));
@@ -252,7 +252,7 @@ parse_cb (GObject *object,
{
GcaService *proxy = (GcaService *)object;
IdeGcaDiagnosticProvider *self;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_autofree gchar *document_path = NULL;
GcaDiagnostics *doc_proxy;
@@ -262,10 +262,10 @@ parse_cb (GObject *object,
IDE_ENTRY;
g_assert (GCA_IS_SERVICE (proxy));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- self = g_task_get_source_object (task);
- state = g_task_get_task_data (task);
+ self = ide_task_get_source_object (task);
+ state = ide_task_get_task_data (task);
ret = gca_service_call_parse_finish (proxy, &document_path, result, &error);
@@ -273,13 +273,13 @@ parse_cb (GObject *object,
{
if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN))
{
- g_task_return_pointer (task, ide_diagnostics_new (NULL),
- (GDestroyNotify)ide_diagnostics_unref);
+ ide_task_return_pointer (task, ide_diagnostics_new (NULL),
+ (GDestroyNotify)ide_diagnostics_unref);
}
else
{
IDE_TRACE_MSG ("%s", error->message);
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
}
IDE_EXIT;
@@ -300,14 +300,14 @@ parse_cb (GObject *object,
G_DBUS_PROXY_FLAGS_NONE,
well_known_name,
document_path,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
get_diag_proxy_cb,
g_object_ref (task));
IDE_EXIT;
}
gca_diagnostics_call_diagnostics (doc_proxy,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
diagnostics_cb,
g_object_ref (task));
@@ -337,7 +337,7 @@ get_proxy_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GVariant) options = NULL;
IdeGcaService *service = (IdeGcaService *)object;
g_autofree gchar *path = NULL;
@@ -350,17 +350,17 @@ get_proxy_cb (GObject *object,
IDE_ENTRY;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (IDE_IS_GCA_SERVICE (service));
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
g_assert (state->task == task);
proxy = ide_gca_service_get_proxy_finish (service, result, &error);
if (!proxy)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_GOTO (cleanup);
}
@@ -369,20 +369,20 @@ get_proxy_cb (GObject *object,
if (!path)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- _("Code assistance requires a local file."));
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ _("Code assistance requires a local file."));
IDE_GOTO (cleanup);
}
if (state->unsaved_file)
{
if (!ide_unsaved_file_persist (state->unsaved_file,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
&error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_GOTO (cleanup);
}
@@ -398,7 +398,7 @@ get_proxy_cb (GObject *object,
temp_path,
cursor,
options,
- g_task_get_cancellable (task),
+ ide_task_get_cancellable (task),
parse_cb,
g_object_ref (task));
@@ -417,7 +417,7 @@ ide_gca_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
gpointer user_data)
{
IdeGcaDiagnosticProvider *self = (IdeGcaDiagnosticProvider *)provider;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IdeGcaService *service;
DiagnoseState *state;
GtkSourceLanguage *language;
@@ -430,7 +430,7 @@ ide_gca_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
g_return_if_fail (IDE_IS_GCA_DIAGNOSTIC_PROVIDER (self));
- task = g_task_new (self, cancellable, callback, user_data);
+ task = ide_task_new (self, cancellable, callback, user_data);
language = ide_file_get_language (file);
@@ -439,10 +439,10 @@ ide_gca_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
if (language_id == NULL)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- "No language specified, code assistance not supported.");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "No language specified, code assistance not supported.");
IDE_EXIT;
}
@@ -457,7 +457,7 @@ ide_gca_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
state->file = g_object_ref (file);
state->unsaved_file = ide_unsaved_files_get_unsaved_file (files, gfile);
- g_task_set_task_data (task, state, diagnose_state_free);
+ ide_task_set_task_data (task, state, diagnose_state_free);
ide_gca_service_get_proxy_async (service, language_id, cancellable,
get_proxy_cb, g_object_ref (task));
@@ -470,15 +470,15 @@ ide_gca_diagnostic_provider_diagnose_finish (IdeDiagnosticProvider *self,
GAsyncResult *result,
GError **error)
{
- GTask *task = (GTask *)result;
+ IdeTask *task = (IdeTask *)result;
IdeDiagnostics *ret;
IDE_ENTRY;
g_return_val_if_fail (IDE_IS_GCA_DIAGNOSTIC_PROVIDER (self), NULL);
- g_return_val_if_fail (G_IS_TASK (task), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (task), NULL);
- ret = g_task_propagate_pointer (task, error);
+ ret = ide_task_propagate_pointer (task, error);
IDE_RETURN (ret);
}
diff --git a/src/plugins/gnome-code-assistance/ide-gca-service.c
b/src/plugins/gnome-code-assistance/ide-gca-service.c
index 1d44397f6..d21a806f6 100644
--- a/src/plugins/gnome-code-assistance/ide-gca-service.c
+++ b/src/plugins/gnome-code-assistance/ide-gca-service.c
@@ -124,29 +124,29 @@ proxy_new_cb (GObject *object,
gpointer user_data)
{
IdeGcaService *self;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
const gchar *language_id;
GcaService *proxy;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (G_IS_ASYNC_RESULT (result));
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
proxy = gca_service_proxy_new_finish (result, &error);
if (!proxy)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
- language_id = g_task_get_task_data (task);
+ language_id = ide_task_get_task_data (task);
g_hash_table_replace (self->proxy_cache, g_strdup (language_id),
g_object_ref (proxy));
- g_task_return_pointer (task, g_object_ref (proxy), g_object_unref);
+ ide_task_return_pointer (task, g_object_ref (proxy), g_object_unref);
g_clear_object (&proxy);
}
@@ -158,7 +158,7 @@ ide_gca_service_get_proxy_async (IdeGcaService *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GError) error = NULL;
g_autofree gchar *name = NULL;
g_autofree gchar *object_path = NULL;
@@ -169,16 +169,16 @@ ide_gca_service_get_proxy_async (IdeGcaService *self,
g_return_if_fail (language_id);
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
+ task = ide_task_new (self, cancellable, callback, user_data);
language_id = remap_language (language_id);
if (!language_id)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- _("No language specified"));
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ _("No language specified"));
return;
}
@@ -186,17 +186,17 @@ ide_gca_service_get_proxy_async (IdeGcaService *self,
if (bus == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
if ((proxy = g_hash_table_lookup (self->proxy_cache, language_id)))
{
- g_task_return_pointer (task, g_object_ref (proxy), g_object_unref);
+ ide_task_return_pointer (task, g_object_ref (proxy), g_object_unref);
return;
}
- g_task_set_task_data (task, g_strdup (language_id), g_free);
+ ide_task_set_task_data (task, g_strdup (language_id), g_free);
name = g_strdup_printf ("org.gnome.CodeAssist.v1.%s", language_id);
object_path = g_strdup_printf ("/org/gnome/CodeAssist/v1/%s", language_id);
@@ -222,12 +222,12 @@ ide_gca_service_get_proxy_finish (IdeGcaService *self,
GAsyncResult *result,
GError **error)
{
- GTask *task = (GTask *)result;
+ IdeTask *task = (IdeTask *)result;
g_return_val_if_fail (IDE_IS_GCA_SERVICE (self), NULL);
- g_return_val_if_fail (G_IS_TASK (task), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (task), NULL);
- return g_task_propagate_pointer (task, error);
+ return ide_task_propagate_pointer (task, error);
}
static void
diff --git a/src/plugins/meson/gbp-meson-build-target-provider.c
b/src/plugins/meson/gbp-meson-build-target-provider.c
index 95f06a915..19b9ecb3c 100644
--- a/src/plugins/meson/gbp-meson-build-target-provider.c
+++ b/src/plugins/meson/gbp-meson-build-target-provider.c
@@ -61,7 +61,7 @@ gbp_meson_build_target_provider_communicate_cb2 (GObject *object,
{
IdeSubprocess *subprocess = (IdeSubprocess *)object;
GbpMesonBuildTargetProvider *self;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
g_autoptr(JsonParser) parser = NULL;
g_autofree gchar *stdout_buf = NULL;
@@ -74,22 +74,22 @@ gbp_meson_build_target_provider_communicate_cb2 (GObject *object,
g_assert (IDE_IS_SUBPROCESS (subprocess));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!ide_subprocess_communicate_utf8_finish (subprocess, result, &stdout_buf, NULL, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
context = ide_object_get_context (IDE_OBJECT (self));
parser = json_parser_new ();
if (!json_parser_load_from_data (parser, stdout_buf, -1, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -97,10 +97,10 @@ gbp_meson_build_target_provider_communicate_cb2 (GObject *object,
!JSON_NODE_HOLDS_OBJECT (root) ||
NULL == (obj = json_node_get_object (root)))
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_INVALID_DATA,
- "Invalid JSON received from meson introspect");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_DATA,
+ "Invalid JSON received from meson introspect");
return;
}
@@ -129,16 +129,16 @@ gbp_meson_build_target_provider_communicate_cb2 (GObject *object,
/* We only need one result */
ret = g_ptr_array_new_with_free_func (g_object_unref);
g_ptr_array_add (ret, gbp_meson_build_target_new (context, gdir, name));
- g_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify)g_ptr_array_unref);
return;
}
}
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "Failed to locate any build targets");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Failed to locate any build targets");
}
static void
@@ -149,7 +149,7 @@ gbp_meson_build_target_provider_communicate_cb (GObject *object,
IdeSubprocess *subprocess = (IdeSubprocess *)object;
GbpMesonBuildTargetProvider *self;
g_autofree gchar *stdout_buf = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(JsonParser) parser = NULL;
g_autoptr(IdeSubprocessLauncher) launcher = NULL;
g_autoptr(IdeSubprocess) all_subprocess = NULL;
@@ -166,11 +166,11 @@ gbp_meson_build_target_provider_communicate_cb (GObject *object,
g_assert (IDE_IS_SUBPROCESS (subprocess));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!ide_subprocess_communicate_utf8_finish (subprocess, result, &stdout_buf, NULL, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -183,7 +183,7 @@ gbp_meson_build_target_provider_communicate_cb (GObject *object,
if (!json_parser_load_from_data (parser, stdout_buf, -1, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -191,14 +191,14 @@ gbp_meson_build_target_provider_communicate_cb (GObject *object,
!JSON_NODE_HOLDS_ARRAY (root) ||
NULL == (array = json_node_get_array (root)))
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_INVALID_DATA,
- "Invalid JSON received from meson introspect");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_DATA,
+ "Invalid JSON received from meson introspect");
return;
}
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
context = ide_object_get_context (IDE_OBJECT (self));
len = json_array_get_length (array);
@@ -265,7 +265,7 @@ gbp_meson_build_target_provider_communicate_cb (GObject *object,
if (ret->len > 0 && found_bindir)
{
- g_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify)g_ptr_array_unref);
+ ide_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify)g_ptr_array_unref);
return;
}
@@ -273,14 +273,14 @@ gbp_meson_build_target_provider_communicate_cb (GObject *object,
if (launcher == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
context = ide_object_get_context (IDE_OBJECT (self));
build_manager = ide_context_get_build_manager (context);
pipeline = ide_build_manager_get_pipeline (build_manager);
- cancellable = g_task_get_cancellable (task);
+ cancellable = ide_task_get_cancellable (task);
ide_subprocess_launcher_push_argv (launcher, "meson");
ide_subprocess_launcher_push_argv (launcher, "introspect");
@@ -291,7 +291,7 @@ gbp_meson_build_target_provider_communicate_cb (GObject *object,
if (all_subprocess == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -312,7 +312,7 @@ gbp_meson_build_target_provider_get_targets_async (IdeBuildTargetProvider *provi
g_autoptr(IdeSubprocessLauncher) launcher = NULL;
g_autoptr(IdeSubprocess) subprocess = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IdeBuildPipeline *pipeline;
IdeBuildManager *build_manager;
IdeBuildSystem *build_system;
@@ -323,19 +323,19 @@ gbp_meson_build_target_provider_get_targets_async (IdeBuildTargetProvider *provi
g_assert (GBP_IS_MESON_BUILD_TARGET_PROVIDER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_meson_build_target_provider_get_targets_async);
- g_task_set_priority (task, G_PRIORITY_LOW);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_meson_build_target_provider_get_targets_async);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
context = ide_object_get_context (IDE_OBJECT (self));
build_system = ide_context_get_build_system (context);
if (!GBP_IS_MESON_BUILD_SYSTEM (build_system))
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- "Not a meson build system, ignoring");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "Not a meson build system, ignoring");
IDE_EXIT;
}
@@ -344,10 +344,10 @@ gbp_meson_build_target_provider_get_targets_async (IdeBuildTargetProvider *provi
if (pipeline == NULL)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "Build pipeline is not ready, cannot extract targets");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Build pipeline is not ready, cannot extract targets");
IDE_EXIT;
}
@@ -355,7 +355,7 @@ gbp_meson_build_target_provider_get_targets_async (IdeBuildTargetProvider *provi
if (launcher == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -367,7 +367,7 @@ gbp_meson_build_target_provider_get_targets_async (IdeBuildTargetProvider *provi
if (subprocess == NULL)
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -390,10 +390,10 @@ gbp_meson_build_target_provider_get_targets_finish (IdeBuildTargetProvider *pro
IDE_ENTRY;
g_assert (GBP_IS_MESON_BUILD_TARGET_PROVIDER (provider));
- g_assert (G_IS_TASK (result));
- g_assert (g_task_is_valid (G_TASK (result), provider));
+ g_assert (IDE_IS_TASK (result));
+ g_assert (ide_task_is_valid (IDE_TASK (result), provider));
- ret = g_task_propagate_pointer (G_TASK (result), error);
+ ret = ide_task_propagate_pointer (IDE_TASK (result), error);
#ifdef IDE_ENABLE_TRACE
if (ret != NULL)
diff --git a/src/plugins/meson/gbp-meson-test-provider.c b/src/plugins/meson/gbp-meson-test-provider.c
index 139adcea9..a4f95bd67 100644
--- a/src/plugins/meson/gbp-meson-test-provider.c
+++ b/src/plugins/meson/gbp-meson-test-provider.c
@@ -349,27 +349,27 @@ gbp_meson_test_provider_run_cb (GObject *object,
gpointer user_data)
{
IdeRunner *runner = (IdeRunner *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
IdeTest *test;
g_assert (IDE_IS_RUNNER (runner));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- test = g_task_get_task_data (task);
+ test = ide_task_get_task_data (task);
g_assert (IDE_IS_TEST (test));
if (!ide_runner_run_finish (runner, result, &error))
{
ide_test_set_status (test, IDE_TEST_STATUS_FAILED);
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
ide_test_set_status (test, IDE_TEST_STATUS_SUCCESS);
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
static void
@@ -380,7 +380,7 @@ gbp_meson_test_provider_run_build_cb (GObject *object,
IdeBuildPipeline *pipeline = (IdeBuildPipeline *)object;
g_autoptr(IdeSubprocess) subprocess = NULL;
g_autoptr(IdeRunner) runner = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
GCancellable *cancellable;
const gchar * const *command;
@@ -394,11 +394,11 @@ gbp_meson_test_provider_run_build_cb (GObject *object,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
if (!ide_build_pipeline_build_finish (pipeline, result, &error))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -408,15 +408,15 @@ gbp_meson_test_provider_run_build_cb (GObject *object,
if (runner == NULL)
{
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "Failed to create runner for executing unit test");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Failed to create runner for executing unit test");
IDE_EXIT;
}
- test = g_task_get_task_data (task);
- cancellable = g_task_get_cancellable (task);
+ test = ide_task_get_task_data (task);
+ cancellable = ide_task_get_cancellable (task);
g_assert (IDE_IS_TEST (test));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
@@ -467,7 +467,7 @@ gbp_meson_test_provider_run_async (IdeTestProvider *provider,
gpointer user_data)
{
GbpMesonTestProvider *self = (GbpMesonTestProvider *)provider;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IDE_ENTRY;
@@ -476,10 +476,10 @@ gbp_meson_test_provider_run_async (IdeTestProvider *provider,
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_meson_test_provider_run_async);
- g_task_set_task_data (task, g_object_ref (test), g_object_unref);
- g_task_set_priority (task, G_PRIORITY_LOW);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_meson_test_provider_run_async);
+ ide_task_set_task_data (task, g_object_ref (test), g_object_unref);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
/* Currently, we don't have a way to determine what targets
* need to be built before the test can run, so we must build
@@ -501,9 +501,9 @@ gbp_meson_test_provider_run_finish (IdeTestProvider *provider,
GError **error)
{
g_assert (IDE_IS_TEST_PROVIDER (provider));
- 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
diff --git a/src/plugins/spellcheck/gbp-spell-dict.c b/src/plugins/spellcheck/gbp-spell-dict.c
index 6a11af4f4..8bf3e5e27 100644
--- a/src/plugins/spellcheck/gbp-spell-dict.c
+++ b/src/plugins/spellcheck/gbp-spell-dict.c
@@ -86,21 +86,21 @@ task_state_free (gpointer data)
}
static void
-read_line_async (GTask *task)
+read_line_async (IdeTask *task)
{
TaskState *state;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
g_assert (state != NULL);
g_assert (state->hash_table != NULL);
g_assert (GBP_IS_SPELL_DICT (state->self));
g_assert (G_IS_DATA_INPUT_STREAM (state->data_stream));
g_data_input_stream_read_line_async (state->data_stream,
- g_task_get_priority (task),
- g_task_get_cancellable (task),
+ ide_task_get_priority (task),
+ ide_task_get_cancellable (task),
read_line_cb,
task);
}
@@ -110,16 +110,16 @@ read_line_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- g_autoptr (GTask) task = (GTask *)user_data;
+ g_autoptr (IdeTask) task = (IdeTask *)user_data;
g_autoptr(GError) error = NULL;
TaskState *state;
gchar *word;
gsize len;
- if (g_task_return_error_if_cancelled (task))
+ if (ide_task_return_error_if_cancelled (task))
return;
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
if (NULL == (word = g_data_input_stream_read_line_finish_utf8 (state->data_stream,
result,
&len,
@@ -128,10 +128,10 @@ read_line_cb (GObject *object,
if (error != NULL)
{
/* TODO: check invalid utf8 string to skip it */
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
}
else
- g_task_return_pointer (task, state->hash_table, (GDestroyNotify)g_hash_table_unref);
+ ide_task_return_pointer (task, state->hash_table, (GDestroyNotify)g_hash_table_unref);
}
else
{
@@ -147,21 +147,21 @@ open_file_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- g_autoptr (GTask) task = (GTask *)user_data;
+ g_autoptr (IdeTask) task = (IdeTask *)user_data;
g_autoptr(GError) error = NULL;
GFileInputStream *stream;
TaskState *state;
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;
- state = g_task_get_task_data (task);
+ state = ide_task_get_task_data (task);
if (NULL == (stream = g_file_read_finish (state->file, result, &error)))
{
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -263,7 +263,7 @@ gbp_spell_dict_get_words_async (GbpSpellDict *self,
GCancellable *cancellable,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autofree gchar *path = NULL;
g_autofree gchar *dict_filename = NULL;
TaskState *state;
@@ -275,9 +275,9 @@ gbp_spell_dict_get_words_async (GbpSpellDict *self,
state = g_slice_new0 (TaskState);
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, gbp_spell_dict_get_words_async);
- g_task_set_task_data (task, state, (GDestroyNotify)task_state_free);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, gbp_spell_dict_get_words_async);
+ ide_task_set_task_data (task, state, (GDestroyNotify)task_state_free);
dict_filename = g_strconcat (gspell_language_get_code (self->language), ".dic", NULL);
path = g_build_filename (g_get_user_config_dir (), "enchant", dict_filename, NULL);
@@ -285,7 +285,7 @@ gbp_spell_dict_get_words_async (GbpSpellDict *self,
state->hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
state->file = g_file_new_for_path (path);
- priority = g_task_get_priority (task);
+ priority = ide_task_get_priority (task);
g_file_read_async (state->file,
priority,
cancellable,
@@ -299,9 +299,9 @@ gbp_spell_dict_get_words_finish (GbpSpellDict *self,
GError **error)
{
g_assert (GBP_IS_SPELL_DICT (self));
- g_assert (g_task_is_valid (result, self));
+ g_assert (ide_task_is_valid (result, self));
- return g_task_propagate_pointer (G_TASK (result), error);
+ return ide_task_propagate_pointer (IDE_TASK (result), error);
}
static void
diff --git a/src/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
b/src/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
index 706a9527c..fd1388c8b 100644
--- a/src/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
+++ b/src/plugins/symbol-tree/gbp-symbol-layout-stack-addin.c
@@ -84,20 +84,20 @@ gbp_symbol_layout_stack_addin_find_scope_cb (GObject *object,
GbpSymbolLayoutStackAddin *self;
g_autoptr(IdeSymbol) symbol = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
SymbolResolverTaskData *data;
g_assert (IDE_IS_SYMBOL_RESOLVER (symbol_resolver));
g_assert (G_IS_ASYNC_RESULT (result));
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
symbol = ide_symbol_resolver_find_nearest_scope_finish (symbol_resolver, result, &error);
g_assert (symbol != NULL || error != NULL);
- self = g_task_get_source_object (task);
+ self = ide_task_get_source_object (task);
g_assert (GBP_IS_SYMBOL_LAYOUT_STACK_ADDIN (self));
- data = g_task_get_task_data (task);
+ data = ide_task_get_task_data (task);
g_assert (data != NULL);
g_assert (IDE_IS_BUFFER (data->buffer));
g_assert (data->resolvers != NULL);
@@ -130,7 +130,7 @@ gbp_symbol_layout_stack_addin_find_scope_cb (GObject *object,
gbp_symbol_menu_button_set_symbol (self->button, symbol);
/* We don't use this, but we should return a value anyway */
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
static gboolean
@@ -154,21 +154,21 @@ gbp_symbol_layout_stack_addin_cursor_moved_cb (gpointer user_data)
if (ide_extension_set_adapter_get_n_extensions (adapter))
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
SymbolResolverTaskData *data;
IdeSymbolResolver *resolver;
self->scope_cancellable = g_cancellable_new ();
- task = g_task_new (self, self->scope_cancellable, NULL, NULL);
- g_task_set_source_tag (task, gbp_symbol_layout_stack_addin_cursor_moved_cb);
- g_task_set_priority (task, G_PRIORITY_LOW);
+ task = ide_task_new (self, self->scope_cancellable, NULL, NULL);
+ ide_task_set_source_tag (task, gbp_symbol_layout_stack_addin_cursor_moved_cb);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
data = g_slice_new0 (SymbolResolverTaskData);
data->resolvers = g_ptr_array_new_with_free_func (g_object_unref);
data->location = ide_buffer_get_insert_location (buffer);
data->buffer = g_object_ref (buffer);
- g_task_set_task_data (task, data, (GDestroyNotify)symbol_resolver_task_data_free);
+ ide_task_set_task_data (task, data, (GDestroyNotify)symbol_resolver_task_data_free);
ide_extension_set_adapter_foreach (adapter, get_extension, data);
g_assert (data->resolvers->len > 0);
@@ -226,17 +226,17 @@ gbp_symbol_layout_stack_addin_get_symbol_tree_cb (GObject *object,
GbpSymbolLayoutStackAddin *self;
g_autoptr(IdeSymbolTree) tree = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
SymbolResolverTaskData *data;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (IDE_IS_SYMBOL_RESOLVER (symbol_resolver));
g_assert (G_IS_ASYNC_RESULT (result));
tree = ide_symbol_resolver_get_symbol_tree_finish (symbol_resolver, result, &error);
- self = g_task_get_source_object (task);
- data = g_task_get_task_data (task);
+ self = ide_task_get_source_object (task);
+ data = ide_task_get_task_data (task);
g_ptr_array_remove_index (data->resolvers, data->resolvers->len - 1);
@@ -278,7 +278,7 @@ gbp_symbol_layout_stack_addin_get_symbol_tree_cb (GObject *object,
}
/* We don't use this, but we should return a value anyway */
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
}
static void
@@ -287,7 +287,7 @@ gbp_symbol_layout_stack_addin_update_tree (GbpSymbolLayoutStackAddin *self,
{
IdeExtensionSetAdapter *adapter;
IdeFile *file;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
SymbolResolverTaskData *data;
IdeSymbolResolver *resolver;
@@ -311,14 +311,14 @@ gbp_symbol_layout_stack_addin_update_tree (GbpSymbolLayoutStackAddin *self,
self->cancellable = g_cancellable_new ();
- task = g_task_new (self, self->cancellable, NULL, NULL);
- g_task_set_source_tag (task, gbp_symbol_layout_stack_addin_update_tree);
- g_task_set_priority (task, G_PRIORITY_LOW);
+ task = ide_task_new (self, self->cancellable, NULL, NULL);
+ ide_task_set_source_tag (task, gbp_symbol_layout_stack_addin_update_tree);
+ ide_task_set_priority (task, G_PRIORITY_LOW);
data = g_slice_new0 (SymbolResolverTaskData);
data->resolvers = g_ptr_array_new_with_free_func (g_object_unref);
data->buffer = g_object_ref (buffer);
- g_task_set_task_data (task, data, (GDestroyNotify)symbol_resolver_task_data_free);
+ ide_task_set_task_data (task, data, (GDestroyNotify)symbol_resolver_task_data_free);
ide_extension_set_adapter_foreach (adapter, get_extension, data);
g_assert (data->resolvers->len > 0);
diff --git a/src/plugins/terminal/gb-terminal-view-actions.c b/src/plugins/terminal/gb-terminal-view-actions.c
index afa2e091c..c2868b91e 100644
--- a/src/plugins/terminal/gb-terminal-view-actions.c
+++ b/src/plugins/terminal/gb-terminal-view-actions.c
@@ -53,19 +53,19 @@ gb_terminal_view_actions_save_finish (GbTerminalView *view,
GAsyncResult *result,
GError **error)
{
- GTask *task = (GTask *)result;
+ IdeTask *task = (IdeTask *)result;
- g_return_val_if_fail (g_task_is_valid (result, view), FALSE);
+ g_return_val_if_fail (ide_task_is_valid (result, view), FALSE);
g_return_val_if_fail (GB_IS_TERMINAL_VIEW (view), FALSE);
- g_return_val_if_fail (G_IS_TASK (result), FALSE);
- g_return_val_if_fail (G_IS_TASK (task), FALSE);
+ g_return_val_if_fail (IDE_IS_TASK (result), FALSE);
+ g_return_val_if_fail (IDE_IS_TASK (task), FALSE);
- return g_task_propagate_boolean (task, error);
+ return ide_task_propagate_boolean (task, error);
}
static void
-save_worker (GTask *task,
+save_worker (IdeTask *task,
gpointer source_object,
gpointer task_data,
GCancellable *cancellable)
@@ -76,7 +76,7 @@ save_worker (GTask *task,
gboolean ret;
g_assert (IDE_IS_MAIN_THREAD ());
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (GB_IS_TERMINAL_VIEW (view));
g_assert (savetask != NULL);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
@@ -102,9 +102,9 @@ save_worker (GTask *task,
}
if (ret)
- g_task_return_boolean (task, TRUE);
+ ide_task_return_boolean (task, TRUE);
else
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
}
static void
@@ -115,14 +115,14 @@ gb_terminal_view_actions_save_async (GbTerminalView *view,
GCancellable *cancellable,
gpointer user_data)
{
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
g_autoptr(GFileOutputStream) output_stream = NULL;
g_autoptr(GError) error = NULL;
SaveTask *savetask;
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (view, cancellable, callback, user_data);
+ task = ide_task_new (view, cancellable, callback, user_data);
output_stream = g_file_replace (file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, cancellable, &error);
@@ -134,11 +134,11 @@ gb_terminal_view_actions_save_async (GbTerminalView *view,
savetask->terminal = g_object_ref (terminal);
savetask->buffer = g_steal_pointer (&view->selection_buffer);
- g_task_set_task_data (task, savetask, savetask_free);
+ ide_task_set_task_data (task, savetask, savetask_free);
save_worker (task, view, savetask, cancellable);
}
else
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
}
static void
@@ -146,13 +146,13 @@ save_as_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- GTask *task = (GTask *)result;
+ IdeTask *task = (IdeTask *)result;
GbTerminalView *view = user_data;
SaveTask *savetask;
GFile *file;
GError *error = NULL;
- savetask = g_task_get_task_data (task);
+ savetask = ide_task_get_task_data (task);
file = g_object_ref (savetask->file);
if (!gb_terminal_view_actions_save_finish (view, result, &error))
diff --git a/src/plugins/xml-pack/ide-xml-diagnostic-provider.c
b/src/plugins/xml-pack/ide-xml-diagnostic-provider.c
index 73d54c39b..3124baae4 100644
--- a/src/plugins/xml-pack/ide-xml-diagnostic-provider.c
+++ b/src/plugins/xml-pack/ide-xml-diagnostic-provider.c
@@ -38,18 +38,18 @@ ide_xml_diagnostic_provider_diagnose_cb (GObject *object,
gpointer user_data)
{
IdeXmlService *service = (IdeXmlService *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
IdeDiagnostics *diagnostics;
IDE_ENTRY;
if (NULL == (diagnostics = ide_xml_service_get_diagnostics_finish (service, result, &error)))
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
else
- g_task_return_pointer (task,
- ide_diagnostics_ref (diagnostics),
- (GDestroyNotify)ide_diagnostics_unref);
+ ide_task_return_pointer (task,
+ ide_diagnostics_ref (diagnostics),
+ (GDestroyNotify)ide_diagnostics_unref);
IDE_EXIT;
}
@@ -63,7 +63,7 @@ ide_xml_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
gpointer user_data)
{
IdeXmlDiagnosticProvider *self = (IdeXmlDiagnosticProvider *)provider;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IdeXmlService *service;
IdeContext *context;
@@ -72,8 +72,8 @@ ide_xml_diagnostic_provider_diagnose_async (IdeDiagnosticProvider *provider,
g_return_if_fail (IDE_IS_XML_DIAGNOSTIC_PROVIDER (self));
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_xml_diagnostic_provider_diagnose_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_xml_diagnostic_provider_diagnose_async);
context = ide_object_get_context (IDE_OBJECT (provider));
service = ide_context_get_service_typed (context, IDE_TYPE_XML_SERVICE);
@@ -93,15 +93,15 @@ ide_xml_diagnostic_provider_diagnose_finish (IdeDiagnosticProvider *provider,
GAsyncResult *result,
GError **error)
{
- GTask *task = (GTask *)result;
+ IdeTask *task = (IdeTask *)result;
IdeDiagnostics *ret;
IDE_ENTRY;
g_return_val_if_fail (IDE_IS_XML_DIAGNOSTIC_PROVIDER (provider), NULL);
- g_return_val_if_fail (G_IS_TASK (task), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (task), NULL);
- ret = g_task_propagate_pointer (task, error);
+ ret = ide_task_propagate_pointer (task, error);
IDE_RETURN (ret);
}
diff --git a/src/plugins/xml-pack/ide-xml-symbol-node.c b/src/plugins/xml-pack/ide-xml-symbol-node.c
index 63d8515a1..5714a508d 100644
--- a/src/plugins/xml-pack/ide-xml-symbol-node.c
+++ b/src/plugins/xml-pack/ide-xml-symbol-node.c
@@ -78,7 +78,7 @@ ide_xml_symbol_node_get_location_async (IdeSymbolNode *node,
gpointer user_data)
{
IdeXmlSymbolNode *self = (IdeXmlSymbolNode *)node;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IdeContext *context;
g_autoptr(IdeFile) ifile = NULL;
IdeSourceLocation *ret;
@@ -87,8 +87,8 @@ ide_xml_symbol_node_get_location_async (IdeSymbolNode *node,
g_return_if_fail (G_IS_FILE (self->file));
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_xml_symbol_node_get_location_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_xml_symbol_node_get_location_async);
context = ide_object_get_context (IDE_OBJECT (self));
ifile = ide_file_new (context, self->file);
@@ -98,7 +98,7 @@ ide_xml_symbol_node_get_location_async (IdeSymbolNode *node,
self->start_tag.start_line_offset - 1,
0);
- g_task_return_pointer (task, ret, (GDestroyNotify)ide_source_location_unref);
+ ide_task_return_pointer (task, ret, (GDestroyNotify)ide_source_location_unref);
}
static IdeSourceLocation *
@@ -107,9 +107,9 @@ ide_xml_symbol_node_get_location_finish (IdeSymbolNode *node,
GError **error)
{
g_return_val_if_fail (IDE_IS_XML_SYMBOL_NODE (node), NULL);
- g_return_val_if_fail (G_IS_TASK (result), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (result), NULL);
- return g_task_propagate_pointer (G_TASK (result), error);
+ return ide_task_propagate_pointer (IDE_TASK (result), error);
}
static void
diff --git a/src/plugins/xml-pack/ide-xml-symbol-resolver.c b/src/plugins/xml-pack/ide-xml-symbol-resolver.c
index 884670eab..55afd7149 100644
--- a/src/plugins/xml-pack/ide-xml-symbol-resolver.c
+++ b/src/plugins/xml-pack/ide-xml-symbol-resolver.c
@@ -41,20 +41,20 @@ ide_xml_symbol_resolver_lookup_symbol_async (IdeSymbolResolver *resolver,
gpointer user_data)
{
IdeXmlSymbolResolver *self = (IdeXmlSymbolResolver *)resolver;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IDE_ENTRY;
g_assert (IDE_IS_XML_SYMBOL_RESOLVER (self));
g_assert (location != NULL);
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, ide_xml_symbol_resolver_lookup_symbol_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_source_tag (task, ide_xml_symbol_resolver_lookup_symbol_async);
- g_task_return_new_error (task,
- G_IO_ERROR,
- G_IO_ERROR_UNKNOWN,
- "No symbol lookup for xml files.");
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_UNKNOWN,
+ "No symbol lookup for xml files.");
IDE_EXIT;
}
@@ -64,12 +64,12 @@ ide_xml_symbol_resolver_lookup_symbol_finish (IdeSymbolResolver *resolver,
GAsyncResult *result,
GError **error)
{
- GTask *task = (GTask *)result;
+ IdeTask *task = (IdeTask *)result;
g_return_val_if_fail (IDE_IS_XML_SYMBOL_RESOLVER (resolver), NULL);
- g_return_val_if_fail (G_IS_TASK (task), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (task), NULL);
- return g_task_propagate_pointer (task, error);
+ return ide_task_propagate_pointer (task, error);
}
static void
@@ -78,24 +78,24 @@ ide_xml_symbol_resolver_get_symbol_tree_cb (GObject *object,
gpointer user_data)
{
IdeXmlService *service = (IdeXmlService *)object;
- g_autoptr(GTask) task = user_data;
+ g_autoptr(IdeTask) task = user_data;
g_autoptr(IdeXmlSymbolNode) root_node = NULL;
IdeXmlSymbolTree *symbol_tree;
g_autoptr(GError) error = NULL;
IDE_ENTRY;
- g_assert (G_IS_TASK (task));
+ g_assert (IDE_IS_TASK (task));
g_assert (IDE_IS_XML_SERVICE (service));
root_node = ide_xml_service_get_root_node_finish (service, result, &error);
if (root_node != NULL)
{
symbol_tree = ide_xml_symbol_tree_new (root_node);
- g_task_return_pointer (task, symbol_tree, g_object_unref);
+ ide_task_return_pointer (task, symbol_tree, g_object_unref);
}
else
- g_task_return_error (task, g_steal_pointer (&error));
+ ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
}
@@ -109,7 +109,7 @@ ide_xml_symbol_resolver_get_symbol_tree_async (IdeSymbolResolver *resolver,
gpointer user_data)
{
IdeXmlSymbolResolver *self = (IdeXmlSymbolResolver *)resolver;
- g_autoptr(GTask) task = NULL;
+ g_autoptr(IdeTask) task = NULL;
IdeContext *context;
IdeXmlService *service;
g_autoptr(IdeFile) ifile = NULL;
@@ -123,9 +123,9 @@ ide_xml_symbol_resolver_get_symbol_tree_async (IdeSymbolResolver *resolver,
context = ide_object_get_context (IDE_OBJECT (self));
service = ide_context_get_service_typed (context, IDE_TYPE_XML_SERVICE);
- task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_task_data (task, g_object_ref (file), g_object_unref);
- g_task_set_source_tag (task, ide_xml_symbol_resolver_get_symbol_tree_async);
+ task = ide_task_new (self, cancellable, callback, user_data);
+ ide_task_set_task_data (task, g_object_ref (file), g_object_unref);
+ ide_task_set_source_tag (task, ide_xml_symbol_resolver_get_symbol_tree_async);
ifile = ide_file_new (context, file);
@@ -145,14 +145,14 @@ ide_xml_symbol_resolver_get_symbol_tree_finish (IdeSymbolResolver *resolver,
GError **error)
{
IdeSymbolTree *ret;
- GTask *task = (GTask *)result;
+ IdeTask *task = (IdeTask *)result;
IDE_ENTRY;
g_return_val_if_fail (IDE_IS_XML_SYMBOL_RESOLVER (resolver), NULL);
- g_return_val_if_fail (G_IS_TASK (task), NULL);
+ g_return_val_if_fail (IDE_IS_TASK (task), NULL);
- ret = g_task_propagate_pointer (task, error);
+ ret = ide_task_propagate_pointer (task, error);
IDE_RETURN (ret);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]