Kouhei Sutou
kous****@users*****
2006年 11月 27日 (月) 16:49:18 JST
Index: tomoe/lib/tomoe-config.c diff -u tomoe/lib/tomoe-config.c:1.39 tomoe/lib/tomoe-config.c:1.40 --- tomoe/lib/tomoe-config.c:1.39 Mon Nov 27 16:21:30 2006 +++ tomoe/lib/tomoe-config.c Mon Nov 27 16:49:17 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-config.c,v 1.39 2006/11/27 07:21:30 kous Exp $ + * $Id: tomoe-config.c,v 1.40 2006/11/27 07:49:17 kous Exp $ */ #ifdef HAVE_CONFIG_H @@ -64,6 +64,8 @@ GValue *value, GParamSpec *pspec); +static void tomoe_config_save (TomoeConfig *config); + static gboolean _tomoe_dict_key_file_get_boolean_value (GKeyFile *key_file, const gchar *group, const gchar *key, @@ -117,7 +119,13 @@ static void tomoe_config_dispose (GObject *object) { - TomoeConfigPrivate *priv = TOMOE_CONFIG_GET_PRIVATE (object); + TomoeConfig *config; + TomoeConfigPrivate *priv; + + config = TOMOE_CONFIG (object); + priv = TOMOE_CONFIG_GET_PRIVATE (config); + + tomoe_config_save (config); if (priv->filename) { g_free (priv->filename); @@ -201,7 +209,7 @@ priv->key_file = key_file; } -void +static void tomoe_config_save (TomoeConfig *config) { TomoeConfigPrivate *priv; Index: tomoe/lib/tomoe-config.h diff -u tomoe/lib/tomoe-config.h:1.20 tomoe/lib/tomoe-config.h:1.21 --- tomoe/lib/tomoe-config.h:1.20 Sat Nov 25 00:57:20 2006 +++ tomoe/lib/tomoe-config.h Mon Nov 27 16:49:17 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-config.h,v 1.20 2006/11/24 15:57:20 kous Exp $ + * $Id: tomoe-config.h,v 1.21 2006/11/27 07:49:17 kous Exp $ */ /** @@ -58,7 +58,6 @@ TomoeConfig *tomoe_config_new (const char *config_file); void tomoe_config_load (TomoeConfig *config); -void tomoe_config_save (TomoeConfig *config); const gchar *tomoe_config_get_filename (TomoeConfig *config); TomoeShelf *tomoe_config_make_shelf (TomoeConfig *config); Index: tomoe/lib/tomoe-context.c diff -u tomoe/lib/tomoe-context.c:1.37 tomoe/lib/tomoe-context.c:1.38 --- tomoe/lib/tomoe-context.c:1.37 Fri Nov 24 14:49:51 2006 +++ tomoe/lib/tomoe-context.c Mon Nov 27 16:49:17 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-context.c,v 1.37 2006/11/24 05:49:51 kous Exp $ + * $Id: tomoe-context.c,v 1.38 2006/11/27 07:49:17 kous Exp $ */ #include "tomoe-dict.h" @@ -130,20 +130,6 @@ priv->recognizer = tomoe_recognizer_new (base_dir, name); } -void -tomoe_context_save (TomoeContext *context) -{ - TomoeContextPrivate *priv; - - g_return_if_fail (context); - priv = TOMOE_CONTEXT_GET_PRIVATE (context); - - if (priv->shelf) - tomoe_shelf_save(priv->shelf); - if (priv->config) - tomoe_config_save(priv->config); -} - static gint _candidate_compare_func (gconstpointer a, gconstpointer b) { Index: tomoe/lib/tomoe-context.h diff -u tomoe/lib/tomoe-context.h:1.27 tomoe/lib/tomoe-context.h:1.28 --- tomoe/lib/tomoe-context.h:1.27 Fri Nov 24 14:54:34 2006 +++ tomoe/lib/tomoe-context.h Mon Nov 27 16:49:18 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-context.h,v 1.27 2006/11/24 05:54:34 kous Exp $ + * $Id: tomoe-context.h,v 1.28 2006/11/27 07:49:18 kous Exp $ */ /** @@ -75,8 +75,6 @@ void tomoe_context_load_recognizer (TomoeContext *ctx, const gchar *base_dir, const gchar *name); -void tomoe_context_save (TomoeContext *ctx); - GList *tomoe_context_search (TomoeContext *ctx, TomoeQuery *query); Index: tomoe/lib/tomoe-dict.c diff -u tomoe/lib/tomoe-dict.c:1.107 tomoe/lib/tomoe-dict.c:1.108 --- tomoe/lib/tomoe-dict.c:1.107 Mon Nov 27 16:48:38 2006 +++ tomoe/lib/tomoe-dict.c Mon Nov 27 16:49:18 2006 @@ -21,7 +21,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-dict.c,v 1.107 2006/11/27 07:48:38 makeinu Exp $ + * $Id: tomoe-dict.c,v 1.108 2006/11/27 07:49:18 kous Exp $ */ #include <stdio.h> @@ -184,6 +184,11 @@ dict = TOMOE_DICT(object); priv = TOMOE_DICT_GET_PRIVATE(dict); + if (priv->modified) { + priv->modified = FALSE; + tomoe_dict_save_xml (dict); + } + g_free(priv->name); g_free(priv->filename); if (priv->letters) @@ -863,6 +868,7 @@ /* clean */ g_free (head); fclose (f); + tomoe_dict_set_modified (dict, FALSE); return; ERROR: Index: tomoe/lib/tomoe-dict.h diff -u tomoe/lib/tomoe-dict.h:1.43 tomoe/lib/tomoe-dict.h:1.44 --- tomoe/lib/tomoe-dict.h:1.43 Wed Nov 22 18:04:47 2006 +++ tomoe/lib/tomoe-dict.h Mon Nov 27 16:49:18 2006 @@ -21,7 +21,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-dict.h,v 1.43 2006/11/22 09:04:47 kous Exp $ + * $Id: tomoe-dict.h,v 1.44 2006/11/27 07:49:18 kous Exp $ */ /** @@ -70,12 +70,6 @@ gboolean editable); /** - * @brief Save tomoe dictionary. - * @param dict - Pointer to the TomoeDict object. - */ -void tomoe_dict_save (TomoeDict *dict); - -/** * @brief Get the file name of the tomoe dictionary. * @param dict - Pointer to the TomoeDict object. * @return File name of the tomoe dictionary. Return NULL if the dictionary Index: tomoe/lib/tomoe-shelf.c diff -u tomoe/lib/tomoe-shelf.c:1.8 tomoe/lib/tomoe-shelf.c:1.9 --- tomoe/lib/tomoe-shelf.c:1.8 Sat Nov 25 12:32:19 2006 +++ tomoe/lib/tomoe-shelf.c Mon Nov 27 16:49:18 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-shelf.c,v 1.8 2006/11/25 03:32:19 kous Exp $ + * $Id: tomoe-shelf.c,v 1.9 2006/11/27 07:49:18 kous Exp $ */ #include "tomoe-dict.h" @@ -149,7 +149,7 @@ tomoe_dict_save(dict); } -void +static void tomoe_shelf_save (TomoeShelf *shelf) { TomoeShelfPrivate *priv; Index: tomoe/lib/tomoe-shelf.h diff -u tomoe/lib/tomoe-shelf.h:1.7 tomoe/lib/tomoe-shelf.h:1.8 --- tomoe/lib/tomoe-shelf.h:1.7 Sat Nov 25 00:57:20 2006 +++ tomoe/lib/tomoe-shelf.h Mon Nov 27 16:49:18 2006 @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * - * $Id: tomoe-shelf.h,v 1.7 2006/11/24 15:57:20 kous Exp $ + * $Id: tomoe-shelf.h,v 1.8 2006/11/27 07:49:18 kous Exp $ */ /** @@ -75,7 +75,6 @@ gboolean tomoe_shelf_remove_dict (TomoeShelf *shelf, const gchar *name); GList *tomoe_shelf_get_dict_names (TomoeShelf *shelf); -void tomoe_shelf_save (TomoeShelf *shelf); gboolean tomoe_shelf_has_dict (TomoeShelf *shelf, const gchar *name);