Commit 0627cc35 authored by Christian Hergert's avatar Christian Hergert
Browse files

util: use dzl_clear_source()

We can remove this from ide-macros and use the one from libdazzle.
parent b3f7802c
......@@ -1719,7 +1719,7 @@ unregister_auto_save (IdeBufferManager *self,
if (state != NULL)
{
g_hash_table_remove (self->timeouts, buffer);
ide_clear_source (&state->source_id);
dzl_clear_source (&state->source_id);
ide_clear_weak_pointer (&state->buffer);
ide_clear_weak_pointer (&state->self);
g_slice_free (AutoSave, state);
......
......@@ -196,7 +196,7 @@ ide_buffer_delay_settling (IdeBuffer *self)
g_assert (IDE_IS_BUFFER (self));
ide_clear_source (&priv->settling_handler);
dzl_clear_source (&priv->settling_handler);
priv->settling_handler = gdk_threads_add_timeout (SETTLING_DELAY_MSEC,
ide_buffer_settled_cb,
self);
......@@ -1397,9 +1397,9 @@ ide_buffer_dispose (GObject *object)
IDE_ENTRY;
ide_clear_source (&priv->settling_handler);
ide_clear_source (&priv->reclamation_handler);
ide_clear_source (&priv->check_modified_timeout);
dzl_clear_source (&priv->settling_handler);
dzl_clear_source (&priv->reclamation_handler);
dzl_clear_source (&priv->check_modified_timeout);
if (priv->context != NULL)
{
......
......@@ -18,6 +18,7 @@
#define G_LOG_DOMAIN "ide-buildconfig-configuration-provider"
#include <dazzle.h>
#include <gio/gio.h>
#include "ide-context.h"
......@@ -43,7 +44,7 @@ struct _IdeBuildconfigConfigurationProvider
GPtrArray *configurations;
GKeyFile *key_file;
gulong writeback_handler;
guint writeback_handler;
guint change_count;
};
......@@ -607,7 +608,7 @@ ide_buildconfig_configuration_provider_unload (IdeConfigurationProvider *provide
g_assert (IDE_IS_BUILDCONFIG_CONFIGURATION_PROVIDER (self));
g_assert (IDE_IS_CONFIGURATION_MANAGER (manager));
ide_clear_source (&self->writeback_handler);
dzl_clear_source (&self->writeback_handler);
if (self->configurations != NULL)
{
......
......@@ -174,7 +174,7 @@ ide_build_manager_stop_timer (IdeBuildManager *self)
g_assert (IDE_IS_BUILD_MANAGER (self));
g_timer_stop (self->running_time);
ide_clear_source (&self->timer_source);
dzl_clear_source (&self->timer_source);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_RUNNING_TIME]);
......@@ -390,7 +390,7 @@ ide_build_manager_invalidate_pipeline (IdeBuildManager *self)
g_assert (self->pipeline != NULL);
self->building = FALSE;
ide_clear_source (&self->timer_source);
dzl_clear_source (&self->timer_source);
g_signal_emit (self, signals [BUILD_FAILED], 0, self->pipeline);
}
......@@ -539,7 +539,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);
ide_clear_source (&self->timer_source);
dzl_clear_source (&self->timer_source);
G_OBJECT_CLASS (ide_build_manager_parent_class)->finalize (object);
}
......
......@@ -537,7 +537,7 @@ ide_diagnostics_manager_finalize (GObject *object)
{
IdeDiagnosticsManager *self = (IdeDiagnosticsManager *)object;
ide_clear_source (&self->queued_diagnose_source);
dzl_clear_source (&self->queued_diagnose_source);
g_clear_pointer (&self->groups_by_file, g_hash_table_unref);
G_OBJECT_CLASS (ide_diagnostics_manager_parent_class)->finalize (object);
......
......@@ -778,7 +778,7 @@ ide_editor_view_destroy (GtkWidget *widget)
g_assert (IDE_IS_EDITOR_VIEW (self));
ide_clear_source (&self->toggle_map_source);
dzl_clear_source (&self->toggle_map_source);
g_clear_object (&self->addins);
......@@ -1160,7 +1160,7 @@ ide_editor_view_update_reveal_timer (IdeEditorView *self)
{
g_assert (IDE_IS_EDITOR_VIEW (self));
ide_clear_source (&self->toggle_map_source);
dzl_clear_source (&self->toggle_map_source);
if (self->auto_hide_map && gtk_revealer_get_reveal_child (self->map_revealer))
{
......
......@@ -37,15 +37,6 @@ G_BEGIN_DECLS
} \
} G_STMT_END
#define ide_clear_source(src) \
G_STMT_START {\
if (*(src) != 0) { \
guint __src_handler_id = *(src); \
*(src) = 0; \
g_source_remove (__src_handler_id); \
} \
} G_STMT_END
/* strlen() generally gets hoisted out automatically */
#define IDE_LITERAL_LENGTH(s) (strlen(s))
......
......@@ -269,7 +269,7 @@ ide_langserv_highlighter_finalize (GObject *object)
priv->engine = NULL;
ide_clear_source (&priv->queued_update);
dzl_clear_source (&priv->queued_update);
g_clear_pointer (&priv->index, ide_highlight_index_unref);
g_clear_object (&priv->buffer_signals);
......
......@@ -479,7 +479,7 @@ ide_layout_stack_header_destroy (GtkWidget *widget)
g_assert (IDE_IS_LAYOUT_STACK_HEADER (self));
ide_clear_source (&self->update_css_handler);
dzl_clear_source (&self->update_css_handler);
g_clear_object (&self->css_provider);
if (self->title_list_box != NULL)
......
......@@ -1380,7 +1380,7 @@ ide_omni_gutter_renderer_dispose (GObject *object)
{
IdeOmniGutterRenderer *self = (IdeOmniGutterRenderer *)object;
ide_clear_source (&self->resize_source);
dzl_clear_source (&self->resize_source);
g_clear_object (&self->breakpoints);
g_clear_pointer (&self->lines, g_array_unref);
......
......@@ -124,7 +124,7 @@ ide_source_map_show_map_and_queue_fade (IdeSourceMap *self)
{
g_assert (IDE_IS_SOURCE_MAP (self));
ide_clear_source (&self->delayed_conceal_timeout);
dzl_clear_source (&self->delayed_conceal_timeout);
if (self->in_map == FALSE)
self->delayed_conceal_timeout = g_timeout_add (CONCEAL_TIMEOUT,
......
......@@ -1071,8 +1071,8 @@ ide_breakout_subprocess_complete_command_locked (IdeBreakoutSubprocess *self,
g_clear_pointer (&self->identifier, g_free);
/* Remove our sources used for signal propagation */
ide_clear_source (&self->sigint_id);
ide_clear_source (&self->sigterm_id);
dzl_clear_source (&self->sigint_id);
dzl_clear_source (&self->sigterm_id);
/* Complete async workers */
waiting = self->waiting;
......@@ -1587,8 +1587,8 @@ ide_breakout_subprocess_dispose (GObject *object)
if (self->waiting != NULL)
g_warning ("improper disposal while async operations are active!");
ide_clear_source (&self->sigint_id);
ide_clear_source (&self->sigterm_id);
dzl_clear_source (&self->sigint_id);
dzl_clear_source (&self->sigterm_id);
G_OBJECT_CLASS (ide_breakout_subprocess_parent_class)->dispose (object);
}
......
......@@ -18,6 +18,8 @@
#define G_LOG_DOMAIN "ide-fancy-tree-view"
#include <dazzle.h>
#include "ide-macros.h"
#include "util/ide-cell-renderer-fancy.h"
......@@ -53,7 +55,7 @@ ide_fancy_tree_view_destroy (GtkWidget *widget)
IdeFancyTreeView *self = (IdeFancyTreeView *)widget;
IdeFancyTreeViewPrivate *priv = ide_fancy_tree_view_get_instance_private (self);
ide_clear_source (&priv->relayout_source);
dzl_clear_source (&priv->relayout_source);
GTK_WIDGET_CLASS (ide_fancy_tree_view_parent_class)->destroy (widget);
}
......
......@@ -232,7 +232,7 @@ motion_notify_event_cb (gpointer data)
{
GbpDocumentationCardViewAddin *self = GBP_DOCUMENTATION_CARD_VIEW_ADDIN (data);
ide_clear_source (&self->timeout_id);
dzl_clear_source (&self->timeout_id);
if (!self->poped_up)
self->timeout_id =
......@@ -295,7 +295,7 @@ gbp_documentation_card_view_addin_unload (IdeEditorViewAddin *addin,
self = GBP_DOCUMENTATION_CARD_VIEW_ADDIN (addin);
source_view = ide_editor_view_get_view (view);
ide_clear_source (&self->timeout_id);
dzl_clear_source (&self->timeout_id);
ide_clear_signal_handler (self->editor_view, &self->motion_handler_id);
g_free (self->previous_text);
......
......@@ -40,7 +40,7 @@ struct _GbpFlatpakConfigurationProvider
GPtrArray *configurations;
GPtrArray *manifest_monitors;
gulong writeback_handler;
guint writeback_handler;
guint change_count;
};
......@@ -1103,7 +1103,7 @@ gbp_flatpak_configuration_provider_unload (IdeConfigurationProvider *provider,
g_assert (GBP_IS_FLATPAK_CONFIGURATION_PROVIDER (self));
g_assert (IDE_IS_CONFIGURATION_MANAGER (manager));
ide_clear_source (&self->writeback_handler);
dzl_clear_source (&self->writeback_handler);
if (self->configurations != NULL)
{
......
......@@ -246,7 +246,7 @@ gbp_history_editor_view_addin_unload (IdeEditorViewAddin *addin,
g_assert (GBP_IS_HISTORY_EDITOR_VIEW_ADDIN (self));
g_assert (IDE_IS_EDITOR_VIEW (view));
ide_clear_source (&self->queued_edit_source);
dzl_clear_source (&self->queued_edit_source);
source_view = ide_editor_view_get_view (view);
buffer = ide_editor_view_get_buffer (view);
......
......@@ -314,7 +314,7 @@ gbp_meson_test_provider_notify_pipeline (GbpMesonTestProvider *self,
g_assert (GBP_IS_MESON_TEST_PROVIDER (self));
g_assert (IDE_IS_BUILD_MANAGER (build_manager));
ide_clear_source (&self->reload_source);
dzl_clear_source (&self->reload_source);
self->reload_source = gdk_threads_add_timeout_full (G_PRIORITY_LOW,
2000,
gbp_meson_test_provider_reload,
......@@ -513,7 +513,7 @@ gbp_meson_test_provider_dispose (GObject *object)
{
GbpMesonTestProvider *self = (GbpMesonTestProvider *)object;
ide_clear_source (&self->reload_source);
dzl_clear_source (&self->reload_source);
g_cancellable_cancel (self->build_cancellable);
g_clear_object (&self->build_cancellable);
......
......@@ -141,7 +141,7 @@ buffer_cursor_moved (GbpQuickHighlightEditorViewAddin *self,
}
else
{
ide_clear_source (&self->queued_match_source);
dzl_clear_source (&self->queued_match_source);
g_clear_object (&self->search_context);
}
}
......@@ -239,7 +239,7 @@ gbp_quick_highlight_editor_view_addin_unload (IdeEditorViewAddin *addin,
g_assert (IDE_IS_EDITOR_VIEW (view));
g_clear_object (&self->search_context);
ide_clear_source (&self->queued_match_source);
dzl_clear_source (&self->queued_match_source);
dzl_signal_group_set_target (self->buffer_signals, NULL);
g_clear_object (&self->buffer_signals);
......
......@@ -306,7 +306,7 @@ gbp_spell_widget__word_entry_changed_cb (GbpSpellWidget *self,
return;
}
ide_clear_source (&self->check_word_timeout_id);
dzl_clear_source (&self->check_word_timeout_id);
if (self->editor_view_addin != NULL)
{
......@@ -961,8 +961,8 @@ gbp_spell_widget_destroy (GtkWidget *widget)
g_assert (GBP_IS_SPELL_WIDGET (self));
ide_clear_source (&self->check_word_timeout_id);
ide_clear_source (&self->dict_check_word_timeout_id);
dzl_clear_source (&self->check_word_timeout_id);
dzl_clear_source (&self->dict_check_word_timeout_id);
if (self->editor != NULL)
gbp_spell_widget_set_editor (self, NULL);
......
......@@ -367,7 +367,7 @@ gbp_symbol_layout_stack_addin_unbind (GbpSymbolLayoutStackAddin *self,
g_assert (GBP_IS_SYMBOL_LAYOUT_STACK_ADDIN (self));
g_assert (DZL_IS_SIGNAL_GROUP (buffer_signals));
ide_clear_source (&self->cursor_moved_handler);
dzl_clear_source (&self->cursor_moved_handler);
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment