epiphany r8360 - branches/gnome-2-24/src



Author: diegoe
Date: Thu Jul 24 20:49:44 2008
New Revision: 8360
URL: http://svn.gnome.org/viewvc/epiphany?rev=8360&view=rev

Log:
Simplify init_action_col and init_url_col.
The completion model was doing uneeded switch'es.


Modified:
   branches/gnome-2-24/src/ephy-completion-model.c

Modified: branches/gnome-2-24/src/ephy-completion-model.c
==============================================================================
--- branches/gnome-2-24/src/ephy-completion-model.c	(original)
+++ branches/gnome-2-24/src/ephy-completion-model.c	Thu Jul 24 20:49:44 2008
@@ -281,23 +281,12 @@
 }
 
 static void
-init_action_col (GValue *value, EphyNode *node, int group)
+init_action_col (GValue *value, EphyNode *node)
 {
 	const char *text;
 
-	switch (group)
-	{
-		case BOOKMARKS_GROUP:
-			text = ephy_node_get_property_string
-				(node, EPHY_NODE_BMK_PROP_LOCATION);
-			break;
-		case HISTORY_GROUP:
-			text = ephy_node_get_property_string
-				(node, EPHY_NODE_PAGE_PROP_LOCATION);
-			break;
-		default:
-			text = "";
-	}
+    text = ephy_node_get_property_string
+        (node, EPHY_NODE_BMK_PROP_LOCATION);
 	
 	g_value_set_string (value, text);
 }
@@ -405,24 +394,12 @@
 }
 
 static void
-init_url_col (GValue *value, EphyNode *node, int group)
+init_url_col (GValue *value, EphyNode *node)
 {
-        const char *url = NULL;
+    const char *url = NULL;
 
-	if (group == BOOKMARKS_GROUP)
-	{
-	        url = ephy_node_get_property_string
-		  (node, EPHY_NODE_BMK_PROP_LOCATION);
-	}
-	else if (group == HISTORY_GROUP)
-	{
-	        url = ephy_node_get_property_string
-		  (node, EPHY_NODE_PAGE_PROP_LOCATION);
-	}
-	else
-	{
-	        url = "";
-	}
+    url = ephy_node_get_property_string
+      (node, EPHY_NODE_PAGE_PROP_LOCATION);
 	
 	g_value_set_string (value, url);
 }
@@ -471,7 +448,7 @@
  			break;
 		case EPHY_COMPLETION_ACTION_COL:
 			g_value_init (value, G_TYPE_STRING);
-			init_action_col (value, node, group);
+			init_action_col (value, node);
 			break;
 		case EPHY_COMPLETION_KEYWORDS_COL:
 			g_value_init (value, G_TYPE_STRING);
@@ -481,10 +458,10 @@
 			g_value_init (value, G_TYPE_INT);
 			init_relevance_col (value, node, group);
 			break;
-                case EPHY_COMPLETION_URL_COL:
-                        g_value_init (value, G_TYPE_STRING);
-                        init_url_col (value, node, group);
-                        break;
+		case EPHY_COMPLETION_URL_COL:
+			g_value_init (value, G_TYPE_STRING);
+			init_url_col (value, node);
+			break;
 	}
 }
 



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