[anjuta/sdb-queries] symbol-db: Implement search in scope query



commit bc4d304c6672d3046b5521c5a5ac57b0ed164fc4
Author: Naba Kumar <naba gnome org>
Date:   Sun Jun 13 13:19:31 2010 +0300

    symbol-db: Implement search in scope query

 plugins/symbol-db/symbol-db-query.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-query.c b/plugins/symbol-db/symbol-db-query.c
index fda9f19..ef5fd3e 100644
--- a/plugins/symbol-db/symbol-db-query.c
+++ b/plugins/symbol-db/symbol-db-query.c
@@ -290,6 +290,15 @@ sdb_query_update (SymbolDBQuery *query)
 				) ";
 			sdb_query_add_field (query, IANJUTA_SYMBOL_FIELD_FILE_PATH);
 			break;
+		case IANJUTA_SYMBOL_QUERY_SEARCH_IN_SCOPE:
+			condition = " (symbol.name LIKE ## /* name:'pattern' type:gchararray */ \
+				AND symbol.scope_id = \
+					(\
+						SELECT scope_definition_id \
+						FROM symbol \
+						WHERE symbol_id = ## /* name:'symbolid' type:gint */ \
+					)) ";
+			break;
 		case IANJUTA_SYMBOL_QUERY_SEARCH_ID:
 			condition = "(symbol.symbol_id = ## /* name:'symbolid' type:gint */)";
 			break;
@@ -958,10 +967,14 @@ sdb_query_search_file (IAnjutaSymbolQuery *query, const gchar *search_string,
 }
 
 static IAnjutaIterable*
-sdb_query_search_in_scope (IAnjutaSymbolQuery *query, const gchar *pattern,
+sdb_query_search_in_scope (IAnjutaSymbolQuery *query, const gchar *search_string,
                            IAnjutaSymbol *scope, GError **error)
 {
-	return NULL; /* FIXME */
+	SDB_QUERY_SEARCH_HEADER;
+	g_return_val_if_fail (priv->name == IANJUTA_SYMBOL_QUERY_SEARCH, NULL);
+	SDB_PARAM_SET_STATIC_STRING (priv->param_pattern, search_string);
+	SDB_PARAM_SET_INT (priv->param_id, ianjuta_symbol_get_int (scope, IANJUTA_SYMBOL_FIELD_ID, NULL));
+	return sdb_query_execute (SYMBOL_DB_QUERY (query));
 }
 
 static IAnjutaIterable*



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