[libgda] Take into account the GDA_TREE_DUMP_ALL_ATTRIBUTES
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Take into account the GDA_TREE_DUMP_ALL_ATTRIBUTES
- Date: Tue, 10 May 2011 21:14:50 +0000 (UTC)
commit c1dfa788c10165b6503708dc22d3a994c378f2c8
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon May 9 18:47:07 2011 +0200
Take into account the GDA_TREE_DUMP_ALL_ATTRIBUTES
to dump all the attributes of each node of a GdaTree
doc/C/libgda-5.0-docs.sgml | 7 ++++++-
libgda/gda-tree-node.c | 38 ++++++++++++++++++--------------------
2 files changed, 24 insertions(+), 21 deletions(-)
---
diff --git a/doc/C/libgda-5.0-docs.sgml b/doc/C/libgda-5.0-docs.sgml
index 67f047d..e52feab 100644
--- a/doc/C/libgda-5.0-docs.sgml
+++ b/doc/C/libgda-5.0-docs.sgml
@@ -462,11 +462,16 @@
<link linkend="gda-data-model-dump">gda_data_model_dump()</link> will also include a description of
the data model's attributes</para>
</listitem>
- <listitem>
+ <listitem>
<para>GDA_CONFIG_SYNCHRONOUS: if set, and if the Gnome Keyring is used to store DSN authentification information,
then the requests to the Gnome Keyring will be made synchronously. This is usefull if Libgda is used in a program where
there is no main loop (otherwise no authentification will be fetched).</para>
</listitem>
+ <listitem>
+ <para>GDA_TREE_DUMP_ALL_ATTRIBUTES: if set, then
+ <link linkend="gda-tree-dump">gda_tree_dump()</link> will dump all the attributes of each
+ node in the tree</para>
+ </listitem>
</itemizedlist>
</para>
</sect1>
diff --git a/libgda/gda-tree-node.c b/libgda/gda-tree-node.c
index b8e9f81..da692d6 100644
--- a/libgda/gda-tree-node.c
+++ b/libgda/gda-tree-node.c
@@ -379,7 +379,6 @@ gda_tree_node_get_property (GObject *object,
}
}
-#ifdef GDA_DEBUG_NO
static void
attributes_foreach_func (const gchar *att_name, const GValue *value, GString *string)
{
@@ -387,8 +386,6 @@ attributes_foreach_func (const gchar *att_name, const GValue *value, GString *st
g_string_append_printf (string, " %s=%s", att_name, str);
g_free (str);
}
-#endif
-
static gchar *
gda_tree_node_dump_header (GdaTreeNode *node)
@@ -397,23 +394,24 @@ gda_tree_node_dump_header (GdaTreeNode *node)
cvalue = gda_attributes_manager_get (gda_tree_node_attributes_manager, node,
GDA_ATTRIBUTE_NAME);
-#ifdef GDA_DEBUG_NO
- GString *string;
- string = g_string_new ("");
- if (cvalue)
- g_string_append (string, g_value_get_string (cvalue));
- else
- g_string_append (string, "Unnamed node");
- g_string_append_c (string, ':');
- gda_attributes_manager_foreach (gda_tree_node_attributes_manager, node,
- (GdaAttributesManagerFunc) attributes_foreach_func, string);
- return g_string_free (string, FALSE);
-#else
- if (cvalue)
- return g_strdup (g_value_get_string (cvalue));
- else
- return g_strdup_printf ("Unnamed node");
-#endif
+ if (g_getenv ("GDA_TREE_DUMP_ALL_ATTRIBUTES")) {
+ GString *string;
+ string = g_string_new ("");
+ if (cvalue && (G_VALUE_TYPE (cvalue) == G_TYPE_STRING))
+ g_string_append (string, g_value_get_string (cvalue));
+ else
+ g_string_append (string, "Unnamed node");
+ g_string_append_c (string, ':');
+ gda_attributes_manager_foreach (gda_tree_node_attributes_manager, node,
+ (GdaAttributesManagerFunc) attributes_foreach_func, string);
+ return g_string_free (string, FALSE);
+ }
+ else {
+ if (cvalue)
+ return g_strdup (g_value_get_string (cvalue));
+ else
+ return g_strdup_printf ("Unnamed node");
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]