[libgda] Doc update and code simplification
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Doc update and code simplification
- Date: Sun, 30 Nov 2014 22:06:14 +0000 (UTC)
commit 55495aaed5ea23bd6bb7dc071ade092b273e1ce0
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Nov 30 22:32:28 2014 +0100
Doc update and code simplification
libgda/gda-quark-list.c | 15 ++++++++++-----
libgda/sqlite/virtual/gda-ldap-connection.h | 5 ++++-
2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/libgda/gda-quark-list.c b/libgda/gda-quark-list.c
index e33d4f8..50a81be 100644
--- a/libgda/gda-quark-list.c
+++ b/libgda/gda-quark-list.c
@@ -353,6 +353,14 @@ name_is_protected (const gchar *name)
* "DB_NAME=notes;USERNAME=al%%20fred" string will specify a username as "al fred"). If this formalism
* is not respected, then some unexpected results may occur.
*
+ * Some corner cases for any string part (delimited by the semi-colon):
+ * <itemisedlist>
+ * <listitem><para>If it does not respect the "<key>=<value>" format then it will be
ignored.</para></listitem>
+ * <listitem><para>Only the 1st equal character is used to separate the key from the value part (which
means
+ * any other equal sign will be part of the value)</para></listitem>
+ * </itemisedlist>
+ *
+ *
* Adds new key->value pairs from the given @string. If @cleanup is
* set to %TRUE, the previous contents will be discarded before adding
* the new pairs.
@@ -371,9 +379,8 @@ gda_quark_list_add_from_string (GdaQuarkList *qlist, const gchar *string, gboole
arr = (gchar **) g_strsplit (string, ";", 0);
if (arr) {
- gint n = 0;
-
- while (arr[n] && (* (arr[n]))) {
+ guint n;
+ for (n = 0; arr[n] && (* (arr[n])); n++) {
gchar **pair;
gchar *tmp;
for (tmp = arr[n]; *tmp; tmp++) {
@@ -382,7 +389,6 @@ gda_quark_list_add_from_string (GdaQuarkList *qlist, const gchar *string, gboole
}
if (!*tmp) {
/* ignore this string since it does not contain the '=' char */
- n++;
continue;
}
@@ -431,7 +437,6 @@ gda_quark_list_add_from_string (GdaQuarkList *qlist, const gchar *string, gboole
}
else
g_strfreev (pair);
- n++;
}
g_strfreev (arr);
}
diff --git a/libgda/sqlite/virtual/gda-ldap-connection.h b/libgda/sqlite/virtual/gda-ldap-connection.h
index 1bd40fa..da440fc 100644
--- a/libgda/sqlite/virtual/gda-ldap-connection.h
+++ b/libgda/sqlite/virtual/gda-ldap-connection.h
@@ -72,7 +72,7 @@ struct _GdaLdapConnectionClass {
* <listitem>
* <para>The CREATE LDAP TABLE: <synopsis>CREATE LDAP TABLE <table name> [BASE=<base DN>]
[FILTER=<LDAP filter>] [ATTRIBUTES=<LDAP attributes>] [SCOPE=<search scope>]</synopsis>
* </para>
- * <para>Each of the BASE, FILTER, ATTRIBUTES and SCOPE specifications is optional. Use this command to
declare a table, for example: <programlisting>CREATE LDAP TABLE users FILTER='(cn=*doe*)' SCOPE=
'SUBTREE';</programlisting>.
+ * <para>Each of the BASE, FILTER, ATTRIBUTES and SCOPE specifications is optional. Use this command to
declare a table, for example: <programlisting>CREATE LDAP TABLE users FILTER='(cn=*doe*)' SCOPE=
'SUBTREE';</programlisting>
* The allowed SCOPE values are: 'BASE', 'ONELEVEL' and 'SUBTREE'.
* </para>
* <para>See the <link
linkend="gda-ldap-connection-declare-table">gda_ldap_connection_declare_table()</link>
@@ -94,6 +94,9 @@ struct _GdaLdapConnectionClass {
* specified parameters are altered (ie. you don't need to repeat the parameters you don't want to
* be modified)
* </para>
+ * <para>Again, refer to the <link
linkend="gda-ldap-connection-declare-table">gda_ldap_connection_declare_table()</link>
+ * section for more information about the ATTRIBUTES syntax.
+ * </para>
* </listitem>
* <listitem>
* <para>The DESCRIBE LDAP TABLE: <synopsis>DESCRIBE LDAP TABLE <table name></synopsis>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]