[gnome-builder/wip/gtk4-port] plugins/xml-pack: remove various dazzle usage
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] plugins/xml-pack: remove various dazzle usage
- Date: Thu, 21 Apr 2022 00:54:03 +0000 (UTC)
commit f437a9468a254623a2c78767e8ca5f7ca33850af
Author: Christian Hergert <chergert redhat com>
Date: Wed Apr 20 17:53:59 2022 -0700
plugins/xml-pack: remove various dazzle usage
src/plugins/xml-pack/ide-xml-completion-attributes.c | 8 ++++----
src/plugins/xml-pack/ide-xml-completion-provider.c | 16 +++++++++-------
src/plugins/xml-pack/ide-xml-service.c | 20 ++++++++++----------
src/plugins/xml-pack/ide-xml-service.h | 8 +++++---
src/plugins/xml-pack/ide-xml-symbol-node.c | 10 ++++------
5 files changed, 32 insertions(+), 30 deletions(-)
---
diff --git a/src/plugins/xml-pack/ide-xml-completion-attributes.c
b/src/plugins/xml-pack/ide-xml-completion-attributes.c
index 6e14cfe21..7883df2c5 100644
--- a/src/plugins/xml-pack/ide-xml-completion-attributes.c
+++ b/src/plugins/xml-pack/ide-xml-completion-attributes.c
@@ -18,7 +18,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-#include <dazzle.h>
+#include "config.h"
#include "ide-xml-completion-attributes.h"
#include "ide-xml-position.h"
@@ -46,7 +46,7 @@ match_item_new (IdeXmlRngDefine *define,
{
MatchItem *item;
- g_assert (!dzl_str_empty0 (attr_name));
+ g_assert (!ide_str_empty0 (attr_name));
item = g_slice_new0 (MatchItem);
@@ -134,7 +134,7 @@ process_attribute (MatchingState *state)
match_children = match_children_new ();
name = (gchar *)state->define->name;
/* XXX: we skip element without a name for now */
- if (dzl_str_empty0 (name))
+ if (ide_str_empty0 (name))
return match_children;
item = match_item_new (state->define, name, state->define->pos, state->is_optional);
@@ -403,7 +403,7 @@ compare_attribute_names (gpointer a,
attr_name = (const gchar *)a;
match = (MatchItem *)b;
- return dzl_str_equal0 (match->name, attr_name);
+ return ide_str_equal0 (match->name, attr_name);
}
static gint
diff --git a/src/plugins/xml-pack/ide-xml-completion-provider.c
b/src/plugins/xml-pack/ide-xml-completion-provider.c
index a09b53eb3..eece5ff61 100644
--- a/src/plugins/xml-pack/ide-xml-completion-provider.c
+++ b/src/plugins/xml-pack/ide-xml-completion-provider.c
@@ -20,9 +20,11 @@
#define G_LOG_DOMAIN "xml-completion"
-#include <dazzle.h>
+#include "config.h"
+
#include <gtksourceview/gtksource.h>
#include <libpeas/peas.h>
+
#include <libide-sourceview.h>
#include "ide-xml-completion-attributes.h"
@@ -373,7 +375,7 @@ completion_item_new (const gchar *label,
{
CompletionItem *item;
- g_assert (!dzl_str_empty0 (label));
+ g_assert (!ide_str_empty0 (label));
g_assert (define != NULL);
item = g_slice_new0 (CompletionItem);
@@ -505,7 +507,7 @@ is_define_equal_node (IdeXmlRngDefine *define,
g_assert (define != NULL);
g_assert (IDE_IS_XML_SYMBOL_NODE (node));
- return dzl_str_equal0 (ide_xml_symbol_node_get_element_name (node), define->name);
+ return ide_str_equal0 (ide_xml_symbol_node_get_element_name (node), define->name);
}
static gboolean
@@ -518,7 +520,7 @@ is_element_matching (MatchingState *state)
g_assert (state->define->type == IDE_XML_RNG_DEFINE_ELEMENT);
/* XXX: we skip element without a name for now */
- if (dzl_str_empty0 ((gchar *)state->define->name))
+ if (ide_str_empty0 ((gchar *)state->define->name))
return FALSE;
if (state->children->len == 0)
@@ -530,7 +532,7 @@ is_element_matching (MatchingState *state)
if (state->candidate_node == node)
{
name = (gchar *)state->define->name;
- if (dzl_str_empty0 (state->prefix) || g_str_has_prefix ((gchar *)state->define->name, state->prefix))
+ if (ide_str_empty0 (state->prefix) || g_str_has_prefix ((gchar *)state->define->name, state->prefix))
{
state->candidate_node = NULL;
state->retry = TRUE;
@@ -845,7 +847,7 @@ get_values_proposals (IdeXmlPosition *position,
GList *results = NULL;
node = ide_xml_position_get_child_node (position);
- g_assert (!dzl_str_empty0 (position->detail_name));
+ g_assert (!ide_str_empty0 (position->detail_name));
if (NULL != (attributes = ide_xml_completion_attributes_get_matches (define, node, FALSE)))
{
@@ -860,7 +862,7 @@ get_values_proposals (IdeXmlPosition *position,
for (gint j = 0; j < attributes->len; ++j)
{
match_item = g_ptr_array_index (attributes, j);
- if (dzl_str_equal0 (detail_name, match_item->name))
+ if (ide_str_equal0 (detail_name, match_item->name))
{
attr_define = match_item->define;
break;
diff --git a/src/plugins/xml-pack/ide-xml-service.c b/src/plugins/xml-pack/ide-xml-service.c
index b6ebcde1d..1e29a4e59 100644
--- a/src/plugins/xml-pack/ide-xml-service.c
+++ b/src/plugins/xml-pack/ide-xml-service.c
@@ -257,7 +257,7 @@ ide_xml_service_get_analysis_cb (GObject *object,
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task));
- if (NULL == (analysis = dzl_task_cache_get_finish (cache, result, &error)))
+ if (NULL == (analysis = ide_task_cache_get_finish (cache, result, &error)))
g_task_return_error (task, g_steal_pointer (&error));
else
g_task_return_pointer (task, g_steal_pointer (&analysis), (GDestroyNotify)ide_xml_analysis_unref);
@@ -280,7 +280,7 @@ ide_xml_service_get_analysis_async (IdeXmlService *self,
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, ide_xml_service_get_analysis_async);
- dzl_task_cache_get_async (self->analyses,
+ ide_task_cache_get_async (self->analyses,
file,
TRUE,
cancellable,
@@ -361,7 +361,7 @@ ide_xml_service_get_root_node_async (IdeXmlService *self,
* If we have a cached analysis with a valid root_node,
* and it is new enough, then re-use it.
*/
- if ((cached = dzl_task_cache_peek (self->analyses, file)))
+ if ((cached = ide_task_cache_peek (self->analyses, file)))
{
IdeContext *context;
IdeUnsavedFiles *unsaved_files;
@@ -475,7 +475,7 @@ ide_xml_service_get_diagnostics_async (IdeXmlService *self,
* If we have a cached analysis with some diagnostics,
* and it is new enough, then re-use it.
*/
- if ((cached = dzl_task_cache_peek (self->analyses, file)))
+ if ((cached = ide_task_cache_peek (self->analyses, file)))
{
IdeContext *context;
IdeUnsavedFiles *unsaved_files;
@@ -545,7 +545,7 @@ ide_xml_service_parent_set (IdeObject *object,
"parent", self,
NULL);
- self->analyses = dzl_task_cache_new ((GHashFunc)g_file_hash,
+ self->analyses = ide_task_cache_new ((GHashFunc)g_file_hash,
(GEqualFunc)g_file_equal,
g_object_ref,
g_object_unref,
@@ -556,10 +556,10 @@ ide_xml_service_parent_set (IdeObject *object,
self,
NULL);
- dzl_task_cache_set_name (self->analyses, "xml analysis cache");
+ ide_task_cache_set_name (self->analyses, "xml analysis cache");
/* There's no eviction time on this cache */
- self->schemas = dzl_task_cache_new ((GHashFunc)g_file_hash,
+ self->schemas = ide_task_cache_new ((GHashFunc)g_file_hash,
(GEqualFunc)g_file_equal,
g_object_ref,
g_object_unref,
@@ -570,7 +570,7 @@ ide_xml_service_parent_set (IdeObject *object,
self,
NULL);
- dzl_task_cache_set_name (self->schemas, "xml schemas cache");
+ ide_task_cache_set_name (self->schemas, "xml schemas cache");
IDE_EXIT;
}
@@ -1072,7 +1072,7 @@ ide_xml_service_get_cached_root_node (IdeXmlService *self,
g_return_val_if_fail (IDE_IS_XML_SERVICE (self), NULL);
g_return_val_if_fail (G_IS_FILE (file), NULL);
- if (NULL != (analysis = dzl_task_cache_peek (self->analyses, file)) &&
+ if (NULL != (analysis = ide_task_cache_peek (self->analyses, file)) &&
NULL != (cached = ide_xml_analysis_get_root_node (analysis)))
return g_object_ref (cached);
@@ -1096,7 +1096,7 @@ ide_xml_service_get_cached_diagnostics (IdeXmlService *self,
g_return_val_if_fail (IDE_IS_XML_SERVICE (self), NULL);
g_return_val_if_fail (G_IS_FILE (file), NULL);
- if (NULL != (analysis = dzl_task_cache_peek (self->analyses, file)) &&
+ if (NULL != (analysis = ide_task_cache_peek (self->analyses, file)) &&
NULL != (cached = ide_xml_analysis_get_diagnostics (analysis)))
return g_object_ref (cached);
diff --git a/src/plugins/xml-pack/ide-xml-service.h b/src/plugins/xml-pack/ide-xml-service.h
index 40ec05699..43abc9be2 100644
--- a/src/plugins/xml-pack/ide-xml-service.h
+++ b/src/plugins/xml-pack/ide-xml-service.h
@@ -20,11 +20,13 @@
#pragma once
-#include <dazzle.h>
#include <gtksourceview/gtksource.h>
+
+#include <libide-code.h>
+#include <libide-io.h>
+
#include "ide-xml-position.h"
#include "ide-xml-symbol-node.h"
-#include <libide-code.h>
G_BEGIN_DECLS
@@ -67,6 +69,6 @@ void ide_xml_service_get_root_node_async (IdeXmlSe
IdeXmlSymbolNode *ide_xml_service_get_root_node_finish (IdeXmlService *self,
GAsyncResult *result,
GError **error);
-DzlTaskCache *ide_xml_service_get_schemas_cache (IdeXmlService *self);
+IdeTaskCache *ide_xml_service_get_schemas_cache (IdeXmlService *self);
G_END_DECLS
diff --git a/src/plugins/xml-pack/ide-xml-symbol-node.c b/src/plugins/xml-pack/ide-xml-symbol-node.c
index d5ebfba4c..229f5456e 100644
--- a/src/plugins/xml-pack/ide-xml-symbol-node.c
+++ b/src/plugins/xml-pack/ide-xml-symbol-node.c
@@ -21,8 +21,6 @@
#define G_LOG_DOMAIN "ide-xml-symbol-node"
-#include <dazzle.h>
-
#include "ide-xml-symbol-node.h"
typedef struct _Attribute
@@ -160,12 +158,12 @@ ide_xml_symbol_node_new (const gchar *name,
"flags", flags,
NULL);
- if (dzl_str_empty0 (element_name))
+ if (ide_str_empty0 (element_name))
self->element_name = g_strdup ("unknown");
else
self->element_name = g_strdup (element_name);
- if (!dzl_str_empty0 (value))
+ if (!ide_str_empty0 (value))
self->value = g_strdup (value);
return self;
@@ -544,7 +542,7 @@ ide_xml_symbol_node_set_element_name (IdeXmlSymbolNode *self,
const gchar *element_name)
{
g_return_if_fail (IDE_IS_XML_SYMBOL_NODE (self));
- g_return_if_fail (!dzl_str_empty0 (element_name));
+ g_return_if_fail (!ide_str_empty0 (element_name));
g_clear_pointer (&self->element_name, g_free);
@@ -717,7 +715,7 @@ ide_xml_symbol_node_get_attribute_value (IdeXmlSymbolNode *self,
for (guint i = 0; i < self->attributes->len; ++i)
{
attr = &g_array_index (self->attributes, Attribute, i);
- if (dzl_str_equal0 (name, attr->name))
+ if (ide_str_equal0 (name, attr->name))
return attr->value;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]