Hiroyuki Ikezoe
ikezo****@users*****
2006年 11月 22日 (水) 15:58:07 JST
Index: libtomoe-gtk/src/tomoe-details.c diff -u libtomoe-gtk/src/tomoe-details.c:1.15 libtomoe-gtk/src/tomoe-details.c:1.16 --- libtomoe-gtk/src/tomoe-details.c:1.15 Wed Nov 22 15:38:15 2006 +++ libtomoe-gtk/src/tomoe-details.c Wed Nov 22 15:58:07 2006 @@ -407,7 +407,7 @@ TomoeDetailsPrivate *priv = TOMOE_DETAILS_GET_PRIVATE (dialog); TomoeChar *c = priv->character; TomoeDict *d = priv->dict; - GPtrArray *readings = tomoe_char_get_readings (c); + const GList *readings = tomoe_char_get_readings (c); char *chr; GtkTreeIter iter; gboolean editable = tomoe_dict_is_editable (d); @@ -434,12 +434,13 @@ if (readings) { int j; - int reading_num = readings->len; + const GList *list; + gint reading_num = g_list_length ((GList *) readings); gchar **str_array = g_new0 (gchar *, reading_num + 1); gchar *readings_text; str_array[reading_num] = NULL; - for (j = 0; j < reading_num; j++) { - str_array[j] = (gchar *)g_ptr_array_index (readings, j); + for (list = readings, j = 0; list; list = g_list_next (list), j++) { + str_array[j] = (gchar *) list->data; } readings_text = g_strjoinv (" ", str_array); gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (priv->basic_prop), @@ -450,7 +451,6 @@ -1); g_free (str_array); g_free (readings_text); - g_ptr_array_free (readings, TRUE); } gtk_text_view_set_buffer (GTK_TEXT_VIEW (priv->meta_view), buf); @@ -561,10 +561,11 @@ g_ptr_array_add (reading_array, g_strdup (readings[i])); } g_strfreev (readings); - tomoe_char_set_readings (priv->character, reading_array); + /* FIXME ! */ + /* tomoe_char_set_readings (priv->character, reading_array);*/ g_ptr_array_free (reading_array, TRUE); } else { - tomoe_char_set_readings (priv->character, NULL); + /* tomoe_char_set_readings (priv->character, NULL); */ } gtk_list_store_set (priv->basic_prop, &iter, PROPERTY_VALUE_COLUMN, new_text, Index: libtomoe-gtk/src/tomoe-dictionary-page.c diff -u libtomoe-gtk/src/tomoe-dictionary-page.c:1.15 libtomoe-gtk/src/tomoe-dictionary-page.c:1.16 --- libtomoe-gtk/src/tomoe-dictionary-page.c:1.15 Wed Nov 22 15:38:15 2006 +++ libtomoe-gtk/src/tomoe-dictionary-page.c Wed Nov 22 15:58:07 2006 @@ -382,9 +382,9 @@ TomoeChar *chr = (TomoeChar*)tomoe_dict_char_by_index (dict, i); gchar *readings_buf = NULL; gchar strokes_text[32]; - int strokes = 0; - int j; - GPtrArray *readings = tomoe_char_get_readings (chr); + gint strokes = 0; + gint j; + const GList *readings = tomoe_char_get_readings (chr); if (tomoe_char_get_writing (chr)) strokes = tomoe_writing_get_number_of_strokes (tomoe_char_get_writing (chr)); @@ -394,15 +394,14 @@ else g_strlcpy (strokes_text, "?", 32); - if (readings->len > 0) { - gchar **reading = g_new0 (gchar*, readings->len + 1); - for (j = 0; j < readings->len; j++) { - reading[j] = g_strdup (g_ptr_array_index (readings, j)); + if (readings) { + gint reading_num = g_list_length ((GList *) readings); + gchar **reading = g_new0 (gchar*, reading_num + 1); + for (j = 0; j < reading_num; j++) { + reading[j] = g_strdup (g_list_nth_data ((GList *) readings, j)); } readings_buf = g_strjoinv (" ", reading); g_free (reading); - } else { - readings_buf = g_strdup (readings_buf); } gtk_list_store_append (priv->store, &iter); gtk_list_store_set (priv->store, &iter, Index: libtomoe-gtk/src/tomoe-reading-search-page.c diff -u libtomoe-gtk/src/tomoe-reading-search-page.c:1.10 libtomoe-gtk/src/tomoe-reading-search-page.c:1.11 --- libtomoe-gtk/src/tomoe-reading-search-page.c:1.10 Wed Nov 22 15:38:15 2006 +++ libtomoe-gtk/src/tomoe-reading-search-page.c Wed Nov 22 15:58:07 2006 @@ -212,7 +212,7 @@ int strokes = 0; int j, reading_num; GtkTreeIter iter; - GPtrArray *readings = tomoe_char_get_readings (chr); + const GList *readings = tomoe_char_get_readings (chr); if (tomoe_char_get_writing (chr)) strokes = tomoe_writing_get_number_of_strokes (tomoe_char_get_writing (chr)); @@ -222,14 +222,14 @@ else strokes_text = g_strdup ("?"); - reading_num = readings->len; - if (reading_num > 0) + if (readings) { + reading_num = g_list_length ((GList *) readings); str_array = g_new0 (gchar *, reading_num + 1); str_array[reading_num] = NULL; for (j = 0; j < reading_num; j++) { - str_array[j] = (gchar *) g_ptr_array_index (readings, j); + str_array[j] = (gchar *) g_list_nth_data ((GList *) readings, j); } readings_text = g_strjoinv (" ", str_array); g_free (str_array);