diff options
author | Xan Lopez <xan@src.gnome.org> | 2003-03-25 05:48:06 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2003-03-25 05:48:06 +0800 |
commit | 4a33f87a3b02445e8e09b76f9400782e7e74d512 (patch) | |
tree | b42211e66354e00ea4e835504dd6c930a7aa0983 | |
parent | 7f3240fa1f99fb9ce69d74cdbde88ab28c5f66bc (diff) | |
download | gsoc2013-epiphany-4a33f87a3b02445e8e09b76f9400782e7e74d512.tar gsoc2013-epiphany-4a33f87a3b02445e8e09b76f9400782e7e74d512.tar.gz gsoc2013-epiphany-4a33f87a3b02445e8e09b76f9400782e7e74d512.tar.bz2 gsoc2013-epiphany-4a33f87a3b02445e8e09b76f9400782e7e74d512.tar.lz gsoc2013-epiphany-4a33f87a3b02445e8e09b76f9400782e7e74d512.tar.xz gsoc2013-epiphany-4a33f87a3b02445e8e09b76f9400782e7e74d512.tar.zst gsoc2013-epiphany-4a33f87a3b02445e8e09b76f9400782e7e74d512.zip |
Insensitive case ordering of strings.
Insensitive case ordering of strings.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/bookmarks/ephy-node-view.c | 13 |
2 files changed, 13 insertions, 6 deletions
@@ -1,3 +1,9 @@ +2003-03-24 Xan Lopez <xan@masilla.org> + + * src/bookmarks/ephy-node-view.c: (ephy_node_view_sort_func): + + Do insensitive case (and linguistically correct) ordering of strings. + 2003-03-24 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmark-properties.c: diff --git a/src/bookmarks/ephy-node-view.c b/src/bookmarks/ephy-node-view.c index afa9505c4..8d75d8a41 100644 --- a/src/bookmarks/ephy-node-view.c +++ b/src/bookmarks/ephy-node-view.c @@ -441,7 +441,7 @@ ephy_node_view_sort_func (GtkTreeModel *model, GType type = gtk_tree_model_get_column_type (model, column); GValue a_value = {0, }; GValue b_value = {0, }; - const char *stra, *strb; + gchar *stra, *strb; gtk_tree_model_get_value (model, a, column, &a_value); gtk_tree_model_get_value (model, b, column, &b_value); @@ -449,14 +449,15 @@ ephy_node_view_sort_func (GtkTreeModel *model, switch (G_TYPE_FUNDAMENTAL (type)) { case G_TYPE_STRING: - stra = g_value_get_string (&a_value); - strb = g_value_get_string (&b_value); - if (stra == NULL) stra = ""; - if (strb == NULL) strb = ""; + stra = g_utf8_casefold (g_value_get_string (&a_value), -1); + strb = g_utf8_casefold (g_value_get_string (&b_value), -1); + g_return_val_if_fail (stra != NULL || strb != NULL, 0); if (column == EPHY_TREE_MODEL_NODE_COL_BOOKMARK || column == EPHY_TREE_MODEL_NODE_COL_KEYWORD) - retval = strcmp (stra, strb); + retval = g_utf8_collate (stra, strb); + g_free (stra); + g_free (strb); break; case G_TYPE_INT: if (g_value_get_int (&a_value) < g_value_get_int (&b_value)) |