[libgda] gda_completion_list_get() improvements



commit 2463a73d127149ca0ac5fb5b545429ee1346a83d
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun Aug 23 14:33:26 2015 +0200

    gda_completion_list_get() improvements

 libgda/gda-util.c |   30 ++----------------------------
 1 files changed, 2 insertions(+), 28 deletions(-)
---
diff --git a/libgda/gda-util.c b/libgda/gda-util.c
index 352cf96..30011f9 100644
--- a/libgda/gda-util.c
+++ b/libgda/gda-util.c
@@ -2091,7 +2091,8 @@ cmp_func (gconstpointer a, gconstpointer b)
 /**
  * gda_completion_list_get:
  * @cnc: a #GdaConnection object
- * @sql: a partial SQL statement which is the context of the completion proposal
+ * @sql: a partial SQL statement which is the context of the completion proposal, may also start with a "." 
for
+ *       Gda's tools which use internal commands
  * @start: starting position within @sql of the "token" to complete (starts at 0)
  * @end: ending position within @sql of the "token" to complete
  *
@@ -2200,33 +2201,6 @@ gda_completion_list_get (GdaConnection *cnc, const gchar *sql, gint start, gint
        }
        
        /*
-        * complete with "table.column"
-        */
-       model = NULL;
-       if (!schema_value)
-               model = gda_meta_store_extract (store, 
-                                               "SELECT column_name FROM _columns", NULL);
-       if (model) {
-               gint i, nrows;
-               gint len = strlen (obj_name);
-               
-               nrows = gda_data_model_get_n_rows (model);
-               for (i = 0; i < nrows; i++) {
-                       cvalue = gda_data_model_get_value_at (model, 0, i, NULL);
-                       if (cvalue) {
-                               const gchar *cname;
-                               cname = g_value_get_string (cvalue);
-                               if (!strncmp (cname, obj_name, len)) {
-                                       gchar *str;
-                                       str = g_strdup (cname);
-                                       g_array_append_val (compl, str);
-                               }
-                       }
-               }
-               g_object_unref (model);
-       }
-       
-       /*
         * complete with "schema.table"
         */
        model = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]