aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@src.gnome.org>2008-07-25 04:49:44 +0800
committerDiego Escalante Urrelo <diegoe@src.gnome.org>2008-07-25 04:49:44 +0800
commitd7b662e7b30776e3a9d1ad8f76e2b6787f66fab9 (patch)
tree786b575f3125feca50b1b61490d6c01d5bcf242f
parente02839c7d5e7aca51b8ab3f1459158731556cf03 (diff)
downloadgsoc2013-epiphany-d7b662e7b30776e3a9d1ad8f76e2b6787f66fab9.tar
gsoc2013-epiphany-d7b662e7b30776e3a9d1ad8f76e2b6787f66fab9.tar.gz
gsoc2013-epiphany-d7b662e7b30776e3a9d1ad8f76e2b6787f66fab9.tar.bz2
gsoc2013-epiphany-d7b662e7b30776e3a9d1ad8f76e2b6787f66fab9.tar.lz
gsoc2013-epiphany-d7b662e7b30776e3a9d1ad8f76e2b6787f66fab9.tar.xz
gsoc2013-epiphany-d7b662e7b30776e3a9d1ad8f76e2b6787f66fab9.tar.zst
gsoc2013-epiphany-d7b662e7b30776e3a9d1ad8f76e2b6787f66fab9.zip
Simplify init_action_col and init_url_col.
The completion model was doing uneeded switch'es. svn path=/branches/gnome-2-24/; revision=8360
-rw-r--r--src/ephy-completion-model.c47
1 files changed, 12 insertions, 35 deletions
diff --git a/src/ephy-completion-model.c b/src/ephy-completion-model.c
index d5581ed71..8e7f2eccb 100644
--- a/src/ephy-completion-model.c
+++ b/src/ephy-completion-model.c
@@ -281,23 +281,12 @@ init_text_col (GValue *value, EphyNode *node, int group)
}
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 @@ init_relevance_col (GValue *value, EphyNode *node, int group)
}
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 @@ ephy_completion_model_get_value (GtkTreeModel *tree_model,
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 @@ ephy_completion_model_get_value (GtkTreeModel *tree_model,
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;
}
}