Hiroyuki Ikezoe
ikezo****@users*****
Wed Dec 6 20:32:58 JST 2006
Index: kazehakase/module/search/kz-anthy-trainer.c diff -u kazehakase/module/search/kz-anthy-trainer.c:1.4 kazehakase/module/search/kz-anthy-trainer.c:1.5 --- kazehakase/module/search/kz-anthy-trainer.c:1.4 Wed Dec 6 19:22:01 2006 +++ kazehakase/module/search/kz-anthy-trainer.c Wed Dec 6 20:32:58 2006 @@ -60,9 +60,6 @@ static void kz_anthy_trainer_init (KzAnthyTrainer *search); /* GObject Class */ -static GObject *constructor (GType type, - guint n_props, - GObjectConstructParam *props); static void dispose (GObject *object); /* KzSearch Class */ @@ -132,7 +129,6 @@ object_class = (GObjectClass *) klass; search_class = (KzSearchClass *) klass; - object_class->constructor = constructor; object_class->dispose = dispose; search_class->get_search_result_html = NULL; @@ -156,26 +152,6 @@ priv->mecab = mecab_new2(""); } -static GObject * -constructor (GType type, - guint n_props, - GObjectConstructParam *props) -{ - GObject *object; - - if (!the_kz_anthy_trainer) - { - GObjectClass *klass = G_OBJECT_CLASS(parent_class); - object = klass->constructor(type, n_props, props); - the_kz_anthy_trainer = KZ_ANTHY_TRAINER(object); - } - else - { - object = g_object_ref(G_OBJECT(the_kz_anthy_trainer)); - } - return object; -} - static void dispose (GObject *object) { @@ -221,8 +197,7 @@ node->stat == MECAB_EOS_NODE) continue; - surface = g_new0(gchar, node->length + 2); - g_snprintf(surface, node->length+1, "%s", node->surface); + surface = g_strndup(node->surface, node->length); g_free(surface); }