[gnome-builder/wip/gtk4-port] foundry: remove use of libdazzle
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] foundry: remove use of libdazzle
- Date: Fri, 24 Sep 2021 20:25:54 +0000 (UTC)
commit 4d9fd32e1ce4134de48ee8d2da23ec29fd9261ba
Author: Christian Hergert <chergert redhat com>
Date: Fri Sep 24 13:25:49 2021 -0700
foundry: remove use of libdazzle
src/libide/foundry/ide-build-manager.c | 41 ++++++++++--------------
src/libide/foundry/ide-config-manager.c | 8 ++---
src/libide/foundry/ide-device-manager.c | 5 +--
src/libide/foundry/ide-pipeline-stage-mkdirs.c | 8 ++---
src/libide/foundry/ide-pipeline-stage-transfer.h | 1 +
src/libide/foundry/ide-pipeline.c | 32 +++++++-----------
src/libide/foundry/ide-run-manager.c | 22 ++++++++-----
src/libide/foundry/ide-runner.c | 6 ++--
src/libide/foundry/ide-runtime.c | 4 +--
src/libide/foundry/ide-test-manager.c | 7 ++--
10 files changed, 63 insertions(+), 71 deletions(-)
---
diff --git a/src/libide/foundry/ide-build-manager.c b/src/libide/foundry/ide-build-manager.c
index c0aa9590d..e6fd1a439 100644
--- a/src/libide/foundry/ide-build-manager.c
+++ b/src/libide/foundry/ide-build-manager.c
@@ -22,8 +22,9 @@
#include "config.h"
-#include <dazzle.h>
#include <glib/gi18n.h>
+
+#include <libide-core.h>
#include <libide-code.h>
#include <libide-threading.h>
#include <libide-vcs.h>
@@ -72,7 +73,7 @@ struct _IdeBuildManager
IdePipeline *pipeline;
GDateTime *last_build_time;
- DzlSignalGroup *pipeline_signals;
+ IdeSignalGroup *pipeline_signals;
gchar *branch_name;
@@ -108,7 +109,7 @@ static void ide_build_manager_action_export (IdeBuildManager *self,
static void ide_build_manager_action_install (IdeBuildManager *self,
GVariant *param);
-DZL_DEFINE_ACTION_GROUP (IdeBuildManager, ide_build_manager, {
+IDE_DEFINE_ACTION_GROUP (IdeBuildManager, ide_build_manager, {
{ "build", ide_build_manager_action_build },
{ "cancel", ide_build_manager_action_cancel },
{ "clean", ide_build_manager_action_clean },
@@ -171,14 +172,7 @@ ide_build_manager_start_timer (IdeBuildManager *self)
else
self->running_time = g_timer_new ();
- /*
- * We use the DzlFrameSource for our timer callback because we only want to
- * update at a rate somewhat close to a typical monitor refresh rate.
- * Additionally, we want to handle drift (which that source does) so that we
- * don't constantly fall behind.
- */
self->timer_source = g_timeout_add_seconds (1, timer_callback, self);
-
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_RUNNING_TIME]);
IDE_EXIT;
@@ -191,7 +185,7 @@ ide_build_manager_stop_timer (IdeBuildManager *self)
g_assert (IDE_IS_BUILD_MANAGER (self));
- dzl_clear_source (&self->timer_source);
+ g_clear_handle_id (&self->timer_source, g_source_remove);
if (self->running_time != NULL)
{
@@ -573,7 +567,7 @@ ide_build_manager_invalidate_pipeline (IdeBuildManager *self)
g_assert (self->pipeline != NULL);
self->building = FALSE;
- dzl_clear_source (&self->timer_source);
+ g_clear_handle_id (&self->timer_source, g_source_remove);
g_signal_emit (self, signals [BUILD_FAILED], 0, self->pipeline);
}
@@ -623,7 +617,7 @@ ide_build_manager_invalidate_pipeline (IdeBuildManager *self)
"device", device,
NULL);
ide_object_append (IDE_OBJECT (self), IDE_OBJECT (self->pipeline));
- dzl_signal_group_set_target (self->pipeline_signals, self->pipeline);
+ ide_signal_group_set_target (self->pipeline_signals, self->pipeline);
/*
* Create a task to manage our async pipeline initialization state.
@@ -820,8 +814,7 @@ ide_build_manager_finalize (GObject *object)
g_clear_pointer (&self->last_build_time, g_date_time_unref);
g_clear_pointer (&self->running_time, g_timer_destroy);
g_clear_pointer (&self->branch_name, g_free);
-
- dzl_clear_source (&self->timer_source);
+ g_clear_handle_id (&self->timer_source, g_source_remove);
G_OBJECT_CLASS (ide_build_manager_parent_class)->finalize (object);
}
@@ -1185,33 +1178,33 @@ ide_build_manager_init (IdeBuildManager *self)
self->cancellable = g_cancellable_new ();
self->needs_rediagnose = TRUE;
- self->pipeline_signals = dzl_signal_group_new (IDE_TYPE_PIPELINE);
+ self->pipeline_signals = ide_signal_group_new (IDE_TYPE_PIPELINE);
- dzl_signal_group_connect_object (self->pipeline_signals,
+ ide_signal_group_connect_object (self->pipeline_signals,
"diagnostic",
G_CALLBACK (ide_build_manager_handle_diagnostic),
self,
G_CONNECT_SWAPPED);
- dzl_signal_group_connect_object (self->pipeline_signals,
+ ide_signal_group_connect_object (self->pipeline_signals,
"notify::busy",
G_CALLBACK (ide_build_manager_notify_busy),
self,
G_CONNECT_SWAPPED);
- dzl_signal_group_connect_object (self->pipeline_signals,
+ ide_signal_group_connect_object (self->pipeline_signals,
"notify::message",
G_CALLBACK (ide_build_manager_notify_message),
self,
G_CONNECT_SWAPPED);
- dzl_signal_group_connect_object (self->pipeline_signals,
+ ide_signal_group_connect_object (self->pipeline_signals,
"started",
G_CALLBACK (ide_build_manager_pipeline_started),
self,
G_CONNECT_SWAPPED);
- dzl_signal_group_connect_object (self->pipeline_signals,
+ ide_signal_group_connect_object (self->pipeline_signals,
"finished",
G_CALLBACK (ide_build_manager_pipeline_finished),
self,
@@ -1495,7 +1488,7 @@ ide_build_manager_build_async (IdeBuildManager *self,
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
g_return_if_fail (!g_cancellable_is_cancelled (self->cancellable));
- cancellable = dzl_cancellable_chain (cancellable, self->cancellable);
+ cancellable = ide_cancellable_chain (cancellable, self->cancellable);
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_source_tag (task, ide_build_manager_build_async);
@@ -1645,7 +1638,7 @@ ide_build_manager_clean_async (IdeBuildManager *self,
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
g_return_if_fail (!g_cancellable_is_cancelled (self->cancellable));
- cancellable = dzl_cancellable_chain (cancellable, self->cancellable);
+ cancellable = ide_cancellable_chain (cancellable, self->cancellable);
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_source_tag (task, ide_build_manager_clean_async);
@@ -1758,7 +1751,7 @@ ide_build_manager_rebuild_async (IdeBuildManager *self,
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
g_return_if_fail (!g_cancellable_is_cancelled (self->cancellable));
- cancellable = dzl_cancellable_chain (cancellable, self->cancellable);
+ cancellable = ide_cancellable_chain (cancellable, self->cancellable);
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_source_tag (task, ide_build_manager_rebuild_async);
diff --git a/src/libide/foundry/ide-config-manager.c b/src/libide/foundry/ide-config-manager.c
index 1aebed222..8e2d38c2f 100644
--- a/src/libide/foundry/ide-config-manager.c
+++ b/src/libide/foundry/ide-config-manager.c
@@ -22,14 +22,14 @@
#include "config.h"
-#include <dazzle.h>
#include <glib/gi18n.h>
-#include <libide-threading.h>
#include <libpeas/peas.h>
+#include <libide-threading.h>
+
+#include "ide-config.h"
#include "ide-config-manager.h"
#include "ide-config-private.h"
-#include "ide-config.h"
#include "ide-config-provider.h"
#define WRITEBACK_DELAY_SEC 3
@@ -65,7 +65,7 @@ static void ide_config_manager_actions_delete (IdeConfigManager *self,
static void ide_config_manager_actions_duplicate (IdeConfigManager *self,
GVariant *param);
-DZL_DEFINE_ACTION_GROUP (IdeConfigManager, ide_config_manager, {
+IDE_DEFINE_ACTION_GROUP (IdeConfigManager, ide_config_manager, {
{ "current", ide_config_manager_actions_current, "s" },
{ "delete", ide_config_manager_actions_delete, "s" },
{ "duplicate", ide_config_manager_actions_duplicate, "s" },
diff --git a/src/libide/foundry/ide-device-manager.c b/src/libide/foundry/ide-device-manager.c
index 2f920bdc7..c35119522 100644
--- a/src/libide/foundry/ide-device-manager.c
+++ b/src/libide/foundry/ide-device-manager.c
@@ -23,9 +23,10 @@
#include "config.h"
#include <glib/gi18n.h>
+#include <libpeas/peas.h>
+
#include <libide-plugins.h>
#include <libide-threading.h>
-#include <libpeas/peas.h>
#include "ide-build-manager.h"
#include "ide-pipeline.h"
@@ -94,7 +95,7 @@ static void ide_device_manager_action_deploy (IdeDeviceManager *self,
GVariant *param);
static void ide_device_manager_deploy_tick (IdeTask *task);
-DZL_DEFINE_ACTION_GROUP (IdeDeviceManager, ide_device_manager, {
+IDE_DEFINE_ACTION_GROUP (IdeDeviceManager, ide_device_manager, {
{ "device", ide_device_manager_action_device, "s", "'local'" },
{ "deploy", ide_device_manager_action_deploy },
})
diff --git a/src/libide/foundry/ide-pipeline-stage-mkdirs.c b/src/libide/foundry/ide-pipeline-stage-mkdirs.c
index a3be032ae..0184ece6c 100644
--- a/src/libide/foundry/ide-pipeline-stage-mkdirs.c
+++ b/src/libide/foundry/ide-pipeline-stage-mkdirs.c
@@ -135,14 +135,14 @@ ide_pipeline_stage_mkdirs_build (IdePipelineStage *stage,
}
static void
-ide_pipeline_stage_mkdirs_reap (IdePipelineStage *stage,
- DzlDirectoryReaper *reaper)
+ide_pipeline_stage_mkdirs_reap (IdePipelineStage *stage,
+ IdeDirectoryReaper *reaper)
{
IdePipelineStageMkdirs *self = (IdePipelineStageMkdirs *)stage;
IdePipelineStageMkdirsPrivate *priv = ide_pipeline_stage_mkdirs_get_instance_private (self);
g_assert (IDE_IS_PIPELINE_STAGE_MKDIRS (self));
- g_assert (DZL_IS_DIRECTORY_REAPER (reaper));
+ g_assert (IDE_IS_DIRECTORY_REAPER (reaper));
ide_pipeline_stage_set_active (stage, TRUE);
@@ -153,7 +153,7 @@ ide_pipeline_stage_mkdirs_reap (IdePipelineStage *stage,
if (path->remove_on_rebuild)
{
g_autoptr(GFile) file = g_file_new_for_path (path->path);
- dzl_directory_reaper_add_directory (reaper, file, 0);
+ ide_directory_reaper_add_directory (reaper, file, 0);
}
}
diff --git a/src/libide/foundry/ide-pipeline-stage-transfer.h
b/src/libide/foundry/ide-pipeline-stage-transfer.h
index 4e3252740..c40e9f754 100644
--- a/src/libide/foundry/ide-pipeline-stage-transfer.h
+++ b/src/libide/foundry/ide-pipeline-stage-transfer.h
@@ -25,6 +25,7 @@
#endif
#include <libide-core.h>
+#include <libide-io.h>
#include "ide-pipeline-stage.h"
diff --git a/src/libide/foundry/ide-pipeline.c b/src/libide/foundry/ide-pipeline.c
index 7eafdcdd6..2ab83d130 100644
--- a/src/libide/foundry/ide-pipeline.c
+++ b/src/libide/foundry/ide-pipeline.c
@@ -23,8 +23,6 @@
#include "config.h"
#include <glib/gi18n.h>
-#include <dazzle.h>
-#include <libide-plugins.h>
#include <libpeas/peas.h>
#include <string.h>
#include <vte/vte.h>
@@ -55,7 +53,6 @@
#include "ide-toolchain.h"
#include "ide-triplet.h"
-DZL_DEFINE_COUNTER (Instances, "Pipeline", "N Pipelines", "Number of Pipeline instances")
G_DEFINE_QUARK (ide_build_error, ide_build_error)
/**
@@ -1420,8 +1417,6 @@ ide_pipeline_finalize (GObject *object)
G_OBJECT_CLASS (ide_pipeline_parent_class)->finalize (object);
- DZL_COUNTER_DEC (Instances);
-
IDE_EXIT;
}
@@ -1808,8 +1803,6 @@ ide_pipeline_class_init (IdePipelineClass *klass)
static void
ide_pipeline_init (IdePipeline *self)
{
- DZL_COUNTER_INC (Instances);
-
self->cancellable = g_cancellable_new ();
self->position = -1;
@@ -2137,7 +2130,7 @@ ide_pipeline_build_targets_async (IdePipeline *self,
g_return_if_fail (IDE_IS_PIPELINE (self));
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
- cancellable = dzl_cancellable_chain (cancellable, self->cancellable);
+ cancellable = ide_cancellable_chain (cancellable, self->cancellable);
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_source_tag (task, ide_pipeline_build_targets_async);
@@ -2463,10 +2456,7 @@ ide_pipeline_queue_flush (IdePipeline *self)
g_assert (IDE_IS_PIPELINE (self));
- gdk_threads_add_idle_full (G_PRIORITY_LOW,
- ide_pipeline_do_flush,
- g_object_ref (self),
- g_object_unref);
+ g_idle_add_full (G_PRIORITY_LOW, ide_pipeline_do_flush, g_object_ref (self), g_object_unref);
IDE_EXIT;
}
@@ -3466,7 +3456,7 @@ ide_pipeline_clean_async (IdePipeline *self,
if (!ide_pipeline_check_ready (self, task))
return;
- dzl_cancellable_chain (cancellable, self->cancellable);
+ ide_cancellable_chain (cancellable, self->cancellable);
td = task_data_new (task, TASK_CLEAN);
td->phase = phase;
@@ -3597,7 +3587,7 @@ ide_pipeline_reaper_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- DzlDirectoryReaper *reaper = (DzlDirectoryReaper *)object;
+ IdeDirectoryReaper *reaper = (IdeDirectoryReaper *)object;
IdePipeline *self;
g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
@@ -3605,7 +3595,7 @@ ide_pipeline_reaper_cb (GObject *object,
IDE_ENTRY;
- g_assert (DZL_IS_DIRECTORY_REAPER (reaper));
+ g_assert (IDE_IS_DIRECTORY_REAPER (reaper));
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (IDE_IS_TASK (task));
@@ -3619,7 +3609,7 @@ ide_pipeline_reaper_cb (GObject *object,
g_assert (IDE_IS_PIPELINE (self));
/* Make sure our reaper completed or else we bail */
- if (!dzl_directory_reaper_execute_finish (reaper, result, &error))
+ if (!ide_directory_reaper_execute_finish (reaper, result, &error))
{
ide_task_return_error (task, g_steal_pointer (&error));
IDE_EXIT;
@@ -3641,7 +3631,7 @@ static void
ide_pipeline_tick_rebuild (IdePipeline *self,
IdeTask *task)
{
- g_autoptr(DzlDirectoryReaper) reaper = NULL;
+ g_autoptr(IdeDirectoryReaper) reaper = NULL;
GCancellable *cancellable;
IDE_ENTRY;
@@ -3659,7 +3649,7 @@ ide_pipeline_tick_rebuild (IdePipeline *self,
}
#endif
- reaper = dzl_directory_reaper_new ();
+ reaper = ide_directory_reaper_new ();
/*
* Check if we can remove the builddir. We don't want to do this if it is the
@@ -3669,7 +3659,7 @@ ide_pipeline_tick_rebuild (IdePipeline *self,
{
g_autoptr(GFile) builddir = g_file_new_for_path (self->builddir);
- dzl_directory_reaper_add_directory (reaper, builddir, 0);
+ ide_directory_reaper_add_directory (reaper, builddir, 0);
}
/*
@@ -3688,7 +3678,7 @@ ide_pipeline_tick_rebuild (IdePipeline *self,
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
/* Now build the reaper to clean up the build files. */
- dzl_directory_reaper_execute_async (reaper,
+ ide_directory_reaper_execute_async (reaper,
cancellable,
ide_pipeline_reaper_cb,
g_object_ref (task));
@@ -3730,7 +3720,7 @@ ide_pipeline_rebuild_async (IdePipeline *self,
drop_caches (self);
- cancellable = dzl_cancellable_chain (cancellable, self->cancellable);
+ cancellable = ide_cancellable_chain (cancellable, self->cancellable);
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_priority (task, G_PRIORITY_LOW);
diff --git a/src/libide/foundry/ide-run-manager.c b/src/libide/foundry/ide-run-manager.c
index c70b16170..8a9c171b9 100644
--- a/src/libide/foundry/ide-run-manager.c
+++ b/src/libide/foundry/ide-run-manager.c
@@ -23,11 +23,13 @@
#include "config.h"
#include <glib/gi18n.h>
-#include <libide-threading.h>
-#include <libide-vcs.h>
#include <libpeas/peas.h>
#include <libpeas/peas-autocleanups.h>
+#include <libide-core.h>
+#include <libide-threading.h>
+#include <libide-vcs.h>
+
#include "ide-private.h"
#include "ide-build-manager.h"
@@ -79,7 +81,7 @@ static void ide_run_manager_actions_run_with_handler (IdeRunManager *self,
static void ide_run_manager_actions_stop (IdeRunManager *self,
GVariant *param);
-DZL_DEFINE_ACTION_GROUP (IdeRunManager, ide_run_manager, {
+IDE_DEFINE_ACTION_GROUP (IdeRunManager, ide_run_manager, {
{ "run", ide_run_manager_actions_run },
{ "run-with-handler", ide_run_manager_actions_run_with_handler, "s" },
{ "stop", ide_run_manager_actions_stop },
@@ -859,7 +861,7 @@ ide_run_manager_run_async (IdeRunManager *self,
if (cancellable == NULL)
cancellable = local_cancellable = g_cancellable_new ();
- dzl_cancellable_chain (cancellable, self->cancellable);
+ ide_cancellable_chain (cancellable, self->cancellable);
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_source_tag (task, ide_run_manager_run_async);
@@ -961,10 +963,6 @@ ide_run_manager_add_handler (IdeRunManager *self,
GDestroyNotify user_data_destroy)
{
IdeRunHandlerInfo *info;
- DzlShortcutManager *manager;
- DzlShortcutTheme *theme;
- g_autofree gchar *action_name = NULL;
- GApplication *app;
g_return_if_fail (IDE_IS_RUN_MANAGER (self));
g_return_if_fail (id != NULL);
@@ -981,6 +979,13 @@ ide_run_manager_add_handler (IdeRunManager *self,
self->handlers = g_list_append (self->handlers, info);
+ /* FIXME: We need a new way to do this for GTK 4. */
+#if 0
+ DzlShortcutManager *manager;
+ DzlShortcutTheme *theme;
+ g_autofree gchar *action_name = NULL;
+ GApplication *app;
+
app = g_application_get_default ();
manager = dzl_application_get_shortcut_manager (DZL_APPLICATION (app));
theme = g_object_ref (dzl_shortcut_manager_get_theme (manager));
@@ -998,6 +1003,7 @@ ide_run_manager_add_handler (IdeRunManager *self,
action_name,
accel,
DZL_SHORTCUT_PHASE_GLOBAL | DZL_SHORTCUT_PHASE_CAPTURE);
+#endif
if (self->handler == NULL)
self->handler = info;
diff --git a/src/libide/foundry/ide-runner.c b/src/libide/foundry/ide-runner.c
index 4d2dd6031..9ad052cdf 100644
--- a/src/libide/foundry/ide-runner.c
+++ b/src/libide/foundry/ide-runner.c
@@ -22,15 +22,15 @@
#include "config.h"
-#include <dazzle.h>
#include <errno.h>
#include <glib/gi18n.h>
-#include <libide-io.h>
-#include <libide-threading.h>
#include <libpeas/peas.h>
#include <stdlib.h>
#include <unistd.h>
+#include <libide-io.h>
+#include <libide-threading.h>
+
#include "ide-build-target.h"
#include "ide-config-manager.h"
#include "ide-config.h"
diff --git a/src/libide/foundry/ide-runtime.c b/src/libide/foundry/ide-runtime.c
index 894762c4d..a1a211c03 100644
--- a/src/libide/foundry/ide-runtime.c
+++ b/src/libide/foundry/ide-runtime.c
@@ -22,11 +22,11 @@
#include "config.h"
-#include <dazzle.h>
#include <glib/gi18n.h>
-#include <libide-threading.h>
#include <string.h>
+#include <libide-threading.h>
+
#include "ide-build-target.h"
#include "ide-config.h"
#include "ide-config-manager.h"
diff --git a/src/libide/foundry/ide-test-manager.c b/src/libide/foundry/ide-test-manager.c
index efc377d27..437c5a5a9 100644
--- a/src/libide/foundry/ide-test-manager.c
+++ b/src/libide/foundry/ide-test-manager.c
@@ -22,10 +22,11 @@
#include "config.h"
-#include <dazzle.h>
+#include <libpeas/peas.h>
+
+#include <libide-core.h>
#include <libide-io.h>
#include <libide-threading.h>
-#include <libpeas/peas.h>
#include "ide-build-manager.h"
#include "ide-pipeline.h"
@@ -90,7 +91,7 @@ static void ide_test_manager_actions_reload (IdeTestManager *self,
static void ide_test_manager_actions_cancel (IdeTestManager *self,
GVariant *param);
-DZL_DEFINE_ACTION_GROUP (IdeTestManager, ide_test_manager, {
+IDE_DEFINE_ACTION_GROUP (IdeTestManager, ide_test_manager, {
{ "cancel", ide_test_manager_actions_cancel },
{ "run-all", ide_test_manager_actions_run_all },
{ "reload-tests", ide_test_manager_actions_reload },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]