[anjuta/symbol-db-model] symbol-db: Terminate query if no db connection is present.



commit b799defea61fa270c9c5a713dd359d8b57d935a3
Author: Naba Kumar <naba gnome org>
Date:   Thu Mar 18 20:36:32 2010 +0200

    symbol-db: Terminate query if no db connection is present.

 plugins/symbol-db/symbol-db-model-global.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-model-global.c b/plugins/symbol-db/symbol-db-model-global.c
index aac6ade..2a83805 100644
--- a/plugins/symbol-db/symbol-db-model-global.c
+++ b/plugins/symbol-db/symbol-db-model-global.c
@@ -64,7 +64,11 @@ symbol_db_model_global_get_n_children (SymbolDBModel *model, gint tree_level,
 	
 	g_return_val_if_fail (SYMBOL_DB_IS_MODEL_GLOBAL (model), 0);
 	priv = GET_PRIV (model);
-	
+
+	/* If engine is not connected, there is nothing we can show */
+	if (!priv->dbe || !symbol_db_engine_is_connected (priv->dbe))
+		return NULL;
+		
 	switch (tree_level)
 	{
 		case 0:
@@ -101,6 +105,10 @@ symbol_db_model_global_get_children (SymbolDBModel *model, gint tree_level,
 	g_return_val_if_fail (SYMBOL_DB_IS_MODEL_GLOBAL (model), 0);
 	priv = GET_PRIV (model);
 	
+	/* If engine is not connected, there is nothing we can show */
+	if (!priv->dbe || !symbol_db_engine_is_connected (priv->dbe))
+		return NULL;
+	
 	g_message ("Retrieving level %d data: %d to %d", tree_level,
 	           offset, offset + limit);
 



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