[anjuta/symbol-db-model] symbol-db: Fixed column positions to align together in different queries
- From: Naba Kumar <naba src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/symbol-db-model] symbol-db: Fixed column positions to align together in different queries
- Date: Sun, 14 Mar 2010 15:26:34 +0000 (UTC)
commit 405e1cdb51b966a8e18785a8c709633cfc89992c
Author: Naba Kumar <naba gnome org>
Date: Sun Mar 14 16:54:01 2010 +0200
symbol-db: Fixed column positions to align together in different queries
plugins/symbol-db/symbol-db-engine-queries.c | 22 +++++++++++-----------
plugins/symbol-db/symbol-db-model-global.c | 7 ++++---
2 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-queries.c b/plugins/symbol-db/symbol-db-engine-queries.c
index 6ddb1d1..131ee05 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.c
+++ b/plugins/symbol-db/symbol-db-engine-queries.c
@@ -245,13 +245,6 @@ sdb_engine_prepare_symbol_info_sql (SymbolDBEngine *dbe, GString *info_data,
"symbol.access_kind_id = sym_access.access_kind_id ");
}
- if (sym_info & SYMINFO_KIND)
- {
- info_data = g_string_append (info_data, ",sym_kind.kind_name AS kind_name");
- join_data = g_string_append (join_data, "LEFT JOIN sym_kind ON "
- "symbol.kind_id = sym_kind.sym_kind_id ");
- }
-
if (sym_info & SYMINFO_TYPE || sym_info & SYMINFO_TYPE_NAME)
{
info_data = g_string_append (info_data, ",sym_type.type_type AS type_type, "
@@ -260,6 +253,13 @@ sdb_engine_prepare_symbol_info_sql (SymbolDBEngine *dbe, GString *info_data,
"symbol.type_id = sym_type.type_id ");
}
+ if (sym_info & SYMINFO_KIND)
+ {
+ info_data = g_string_append (info_data, ",sym_kind.kind_name AS kind_name");
+ join_data = g_string_append (join_data, "LEFT JOIN sym_kind ON "
+ "symbol.kind_id = sym_kind.sym_kind_id ");
+ }
+
if (sym_info & SYMINFO_PROJECT_NAME ||
sym_info & SYMINFO_FILE_IGNORE ||
sym_info & SYMINFO_FILE_INCLUDE)
@@ -641,8 +641,8 @@ symbol_db_engine_get_global_members_filtered (SymbolDBEngine *dbe,
query_str = g_strdup_printf ("SELECT symbol.symbol_id AS symbol_id, "
"symbol.name AS name, symbol.file_position AS file_position, "
"symbol.is_file_scope AS is_file_scope, "
- "symbol.signature AS signature, symbol.returntype AS returntype, "
- "sym_kind.kind_name AS kind_name %s FROM symbol "
+ "symbol.signature AS signature, symbol.returntype AS returntype"
+ " %s, sym_kind.kind_name AS kind_name FROM symbol "
"JOIN sym_kind ON symbol.kind_id = sym_kind.sym_kind_id %s "
"WHERE symbol.scope_id <= 0 AND symbol.is_file_scope = 0 "
"%s order by name %s %s", info_data->str, join_data->str,
@@ -714,8 +714,8 @@ symbol_db_engine_get_global_members_filtered (SymbolDBEngine *dbe,
query_str = g_strdup_printf ("SELECT symbol.symbol_id AS symbol_id, "
"symbol.name AS name, symbol.file_position AS file_position, "
"symbol.is_file_scope AS is_file_scope, symbol.signature AS signature, "
- "symbol.returntype AS returntype, "
- "sym_kind.kind_name AS kind_name %s FROM symbol "
+ "symbol.returntype AS returntype "
+ "%s, sym_kind.kind_name AS kind_name FROM symbol "
"%s JOIN sym_kind ON symbol.kind_id = sym_kind.sym_kind_id "
"WHERE symbol.scope_id <= 0 AND symbol.is_file_scope = 0 "
"%s %s order by name %s %s", info_data->str, join_data->str,
diff --git a/plugins/symbol-db/symbol-db-model-global.c b/plugins/symbol-db/symbol-db-model-global.c
index ff2d0da..aac6ade 100644
--- a/plugins/symbol-db/symbol-db-model-global.c
+++ b/plugins/symbol-db/symbol-db-model-global.c
@@ -36,9 +36,9 @@ enum {
DATA_COL_SYMBOL_FILE_SCOPE,
DATA_COL_SYMBOL_ARGS,
DATA_COL_SYMBOL_RETURNTYPE,
- DATA_COL_SYMBOL_KIND_NAME,
DATA_COL_SYMBOL_FILE_PATH,
DATA_COL_SYMBOL_ACCESS,
+ DATA_COL_SYMBOL_KIND_NAME,
DATA_COL_SYMBOL_TYPE,
DATA_COL_SYMBOL_TYPE_NAME,
DATA_N_COLS
@@ -111,13 +111,14 @@ symbol_db_model_global_get_children (SymbolDBModel *model, gint tree_level,
(priv->dbe, SYMTYPE_CLASS | SYMTYPE_ENUM | SYMTYPE_STRUCT |
SYMTYPE_TYPEDEF | SYMTYPE_UNION, TRUE, TRUE, limit, offset,
SYMINFO_SIMPLE | SYMINFO_ACCESS | SYMINFO_TYPE |
- SYMINFO_FILE_PATH);
+ SYMINFO_KIND | SYMINFO_FILE_PATH);
break;
case 1:
symbol_id = g_value_get_int (&column_values[DATA_COL_SYMBOL_ID]);
iter = symbol_db_engine_get_scope_members_by_symbol_id
(priv->dbe, symbol_id, limit, offset, SYMINFO_SIMPLE |
- SYMINFO_ACCESS | SYMINFO_TYPE | SYMINFO_FILE_PATH);
+ SYMINFO_KIND | SYMINFO_ACCESS | SYMINFO_TYPE |
+ SYMINFO_FILE_PATH);
break;
default:
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]