[anjuta/symbol-db-model] symbol-db: Reordered funtions and fixed warnings



commit cc927098e2bc07ef1263b24ef2caabe31d049d7c
Author: Naba Kumar <naba gnome org>
Date:   Sun Mar 14 00:03:04 2010 +0200

    symbol-db: Reordered funtions and fixed warnings

 plugins/symbol-db/symbol-db-model-global.c |   63 ++++++++++++++-------------
 1 files changed, 33 insertions(+), 30 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-model-global.c b/plugins/symbol-db/symbol-db-model-global.c
index ff61578..2636f75 100644
--- a/plugins/symbol-db/symbol-db-model-global.c
+++ b/plugins/symbol-db/symbol-db-model-global.c
@@ -142,33 +142,6 @@ symbol_db_model_global_get_children (SymbolDBModel *model, gint tree_level,
 	return data_model;
 }
 
-static void
-symbol_db_model_global_init (SymbolDBModelGlobal *object)
-{
-	SymbolDBModelGlobalPriv *priv;
-	GType types[] = {G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING};
-	gint data_cols[] = {DATA_COL_SYMBOL_ID, -1, DATA_COL_SYMBOL_NAME};
-	
-	g_return_if_fail (SYMBOL_DB_IS_MODEL_GLOBAL (object));
-	priv = GET_PRIV (object);
-	
-	priv->dbe = NULL;
-	symbol_db_model_set_columns (SYMBOL_DB_MODEL (object), 3, types, data_cols);
-}
-
-static void
-symbol_db_model_global_finalize (GObject *object)
-{
-	SymbolDBModelGlobalPriv *priv;
-
-	g_return_if_fail (SYMBOL_DB_IS_MODEL_GLOBAL (object));
-	priv = GET_PRIV (object);
-	
-	if (priv->dbe)
-		g_object_unref (priv->dbe);
-	G_OBJECT_CLASS (symbol_db_model_global_parent_class)->finalize (object);
-}
-
 static gboolean
 symbol_db_model_global_get_query_value (SymbolDBModel *model,
                                         GdaDataModel *data_model,
@@ -177,16 +150,19 @@ symbol_db_model_global_get_query_value (SymbolDBModel *model,
                                         GValue *value)
 {
 	const GdkPixbuf *pixbuf;
-	const gchar *type, *access;
 	const GValue *ret_value;
+	const gchar *type = NULL;
+	const gchar *access = NULL;
 
 	switch (column)
 	{
 	case SYMBOL_DB_MODEL_GLOBAL_COL_PIXBUF:
 		ret_value = gda_data_model_iter_get_value_for_field (iter, "type_type");
-		type = g_value_get_string (ret_value);
+		if (ret_value && G_VALUE_HOLDS_STRING (ret_value))
+				type = g_value_get_string (ret_value);
 		ret_value = gda_data_model_iter_get_value_for_field (iter, "access_name");
-		access = g_value_get_string (ret_value);
+		if (ret_value && G_VALUE_HOLDS_STRING (ret_value))
+				access = g_value_get_string (ret_value);
 
 		pixbuf = symbol_db_util_get_pixbuf (type, access);
 		g_value_set_object (value, G_OBJECT (pixbuf));
@@ -242,6 +218,33 @@ symbol_db_model_global_get_property (GObject *object, guint prop_id,
 }
 
 static void
+symbol_db_model_global_finalize (GObject *object)
+{
+	SymbolDBModelGlobalPriv *priv;
+
+	g_return_if_fail (SYMBOL_DB_IS_MODEL_GLOBAL (object));
+	priv = GET_PRIV (object);
+	
+	if (priv->dbe)
+		g_object_unref (priv->dbe);
+	G_OBJECT_CLASS (symbol_db_model_global_parent_class)->finalize (object);
+}
+
+static void
+symbol_db_model_global_init (SymbolDBModelGlobal *object)
+{
+	SymbolDBModelGlobalPriv *priv;
+	GType types[] = {G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING};
+	gint data_cols[] = {DATA_COL_SYMBOL_ID, -1, DATA_COL_SYMBOL_NAME};
+	
+	g_return_if_fail (SYMBOL_DB_IS_MODEL_GLOBAL (object));
+	priv = GET_PRIV (object);
+	
+	priv->dbe = NULL;
+	symbol_db_model_set_columns (SYMBOL_DB_MODEL (object), 3, types, data_cols);
+}
+
+static void
 symbol_db_model_global_class_init (SymbolDBModelGlobalClass *klass)
 {
 	GObjectClass* object_class = G_OBJECT_CLASS (klass);



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