[anjuta] symbol-db: small comments fixes.



commit 3c7c1458125e6f9354506c43f161a7846c83a3bf
Author: Massimo Corà <mcora src gnome org>
Date:   Mon Jan 17 23:53:26 2011 +0100

    symbol-db: small comments fixes.

 plugins/symbol-db/symbol-db-engine-utils.c |    3 +++
 plugins/symbol-db/symbol-db-engine-utils.h |    3 +++
 plugins/symbol-db/symbol-db-query.c        |   12 +++++++-----
 3 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-utils.c b/plugins/symbol-db/symbol-db-engine-utils.c
index 02609e2..fe1abe8 100644
--- a/plugins/symbol-db/symbol-db-engine-utils.c
+++ b/plugins/symbol-db/symbol-db-engine-utils.c
@@ -71,12 +71,15 @@ symbol_db_util_get_file_db_path (SymbolDBEngine *dbe, const gchar* full_local_fi
 	SymbolDBEnginePriv *priv;
 	g_return_val_if_fail (dbe != NULL, NULL);
 	g_return_val_if_fail (full_local_file_path != NULL, NULL);
+	g_return_val_if_fail (priv->project_directory != NULL, NULL);
 		
 	priv = dbe->priv;
 	
 	if (priv->db_directory == NULL ||
 	    strlen (priv->project_directory) >= strlen (full_local_file_path)) 
+	{
 		return NULL;
+	}
 
 	return full_local_file_path + strlen (priv->project_directory);
 }
diff --git a/plugins/symbol-db/symbol-db-engine-utils.h b/plugins/symbol-db/symbol-db-engine-utils.h
index 12c9025..38051aa 100644
--- a/plugins/symbol-db/symbol-db-engine-utils.h
+++ b/plugins/symbol-db/symbol-db-engine-utils.h
@@ -56,6 +56,9 @@ symbol_db_util_get_full_local_path (SymbolDBEngine *dbe, const gchar* db_file);
  * @return a db-relativ file path. Es. given the full_local_file_path 
  * /home/user/foo_project/src/foo.c returned file should be /src/foo.c.
  * Return NULL on error.
+ * Please note that the returned const gchar is related to full_local_file_path:
+ * don't free full_local_file_path before having used the returned char, otherwise
+ * they both will become invalid.
  */
 const gchar *
 symbol_db_util_get_file_db_path (SymbolDBEngine *dbe, const gchar* full_local_file_path);
diff --git a/plugins/symbol-db/symbol-db-query.c b/plugins/symbol-db/symbol-db-query.c
index a062519..4d0a3a8 100644
--- a/plugins/symbol-db/symbol-db-query.c
+++ b/plugins/symbol-db/symbol-db-query.c
@@ -279,7 +279,7 @@ sdb_query_build_sql_kind_filter (SymbolDBQuery *query, GString *sql)
  * @query: The query.
  * @field: The field to add.
  * 
- * Adds @field to current list of fields if it does not already is there.
+ * Adds @field to current list of fields if it isn't already there.
  * It is used to add additional required fields for some queries which the
  * user may not have set himself.
  */
@@ -321,7 +321,7 @@ sdb_query_reset (SymbolDBQuery *query)
  * 
  * Updates the SQL query based on latest set paramenters. Usually called
  * after some parameter influencing the SQL contruct is changed. It will
- * also attempt of compile the resulting SQL statement if possible, otherwise
+ * also attempt to compile the resulting SQL statement if possible, otherwise
  * defer it for later when for database connection is established.
  */
 static void
@@ -545,7 +545,7 @@ sdb_query_handle_result (SymbolDBQuery *query, SymbolDBQueryResult *result)
  * The callback from async command. Reduces the currently pending async
  * command invocation counts. If there are no more pending canceled commands
  * anymore, then emits the "async-result" signal (because its not covered by
- * the cancelatoin), otherwise, it reduces cancelable commands count.
+ * the cancelation), otherwise, it reduces cancelable commands count.
  */
 static gboolean
 on_sdb_query_async_poll (gpointer data)
@@ -657,8 +657,8 @@ on_sdb_query_dbe_scan_end (SymbolDBEngine *dbe, gint something,
  * it is defered until the DB is done scanning (at which point "async-result"
  * will be emitted).
  *
- * Returns: The resultset iterator for sync or sucessful queued queries,
- * otherwise returns NULL for async or unsuccessful queued queires (their
+ * Returns: The resultset iterator for sync or successful queued queries,
+ * otherwise returns NULL for async or unsuccessful queued queries (their
  * results will be delivered via "async-result" signal).
  */
 static IAnjutaIterable*
@@ -692,6 +692,8 @@ sdb_query_execute (SymbolDBQuery *query)
 			return NULL;
 		case IANJUTA_SYMBOL_QUERY_MODE_QUEUED:
 			query->priv->query_queued = TRUE;
+
+			/* FIXME: shoudn't be called with g_idle_add ? */
 			on_sdb_query_dbe_scan_end (NULL, 0, query);
 			break;
 		default:



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