summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2006-03-06 13:05:46 +0000
committerMark McLoughlin <markmc@src.gnome.org>2006-03-06 13:05:46 +0000
commit4e23de35babefb971c3ed39dba23972613585e68 (patch)
tree05a91b8716651603399598eb34eab91482d8d4da
parent4bd1baf933383bab75e1742b04b802724c0b3a87 (diff)
downloadgconf-4e23de35babefb971c3ed39dba23972613585e68.tar.gz
Based on patch from Josselin Mouette <joss@debian.org> in bug #333353 to
2006-03-06 Mark McLoughlin <mark@skynet.ie> Based on patch from Josselin Mouette <joss@debian.org> in bug #333353 to speed up the install of multiple schem files * gconf/gconftool.c: (do_load_file): split do_sync() out of here (main), (do_makefile_install): call do_sync() after calling do_load_file()
-rw-r--r--ChangeLog11
-rw-r--r--gconf/gconftool.c35
2 files changed, 29 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index a8f02064..614b8960 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2006-03-06 Mark McLoughlin <mark@skynet.ie>
+ Based on patch from Josselin Mouette <joss@debian.org>
+ in bug #333353 to speed up the install of multiple
+ schem files
+
+ * gconf/gconftool.c:
+ (do_load_file): split do_sync() out of here
+ (main), (do_makefile_install): call do_sync()
+ after calling do_load_file()
+
+2006-03-06 Mark McLoughlin <mark@skynet.ie>
+
Patch from Christopher.Hanna@sun.com
* doc/gconftool-2.1: improved man page
diff --git a/gconf/gconftool.c b/gconf/gconftool.c
index 02a7f590..9c498e43 100644
--- a/gconf/gconftool.c
+++ b/gconf/gconftool.c
@@ -476,6 +476,7 @@ static int do_unset(GConfEngine* conf, const gchar** args);
static int do_recursive_unset (GConfEngine* conf, const gchar** args);
static int do_all_subdirs(GConfEngine* conf, const gchar** args);
static int do_load_file(GConfEngine* conf, LoadType load_type, gboolean unload, const gchar* file, const gchar** base_dirs);
+static int do_sync(GConfEngine* conf);
static int do_short_docs (GConfEngine *conf, const gchar **args);
static int do_long_docs (GConfEngine *conf, const gchar **args);
static int do_get_schema_name (GConfEngine *conf, const gchar **args);
@@ -841,6 +842,8 @@ main (int argc, char** argv)
gint retval;
retval = do_load_file(conf, LOAD_SCHEMA_FILE, FALSE, schema_file, NULL);
+ if (!retval)
+ retval = do_sync(conf);
gconf_engine_unref(conf);
@@ -853,6 +856,8 @@ main (int argc, char** argv)
gint retval;
retval = do_load_file(conf, LOAD_ENTRY_FILE, FALSE, entry_file, args);
+ if (!retval)
+ retval = do_sync(conf);
gconf_engine_unref(conf);
@@ -865,6 +870,8 @@ main (int argc, char** argv)
gint retval;
retval = do_load_file(conf, LOAD_ENTRY_FILE, TRUE, unload_entry_file, args);
+ if (!retval)
+ retval = do_sync(conf);
gconf_engine_unref(conf);
@@ -3629,7 +3636,6 @@ do_load_file(GConfEngine* conf, LoadType load_type, gboolean unload, const gchar
xmlDocPtr doc;
xmlNodePtr iter;
- GError * err = NULL;
/* file comes from the command line, is thus in locale charset */
gchar *utf8_file = g_locale_to_utf8 (file, -1, NULL, NULL, NULL);;
@@ -3691,7 +3697,17 @@ do_load_file(GConfEngine* conf, LoadType load_type, gboolean unload, const gchar
iter = iter->next;
}
+
+ return 0;
+#undef LOAD_TYPE_TO_LIST
+#undef LOAD_TYPE_TO_ROOT
+}
+static int
+do_sync(GConfEngine* conf)
+{
+ GError *err = NULL;
+
gconf_engine_suggest_sync(conf, &err);
if (err != NULL)
@@ -3703,16 +3719,11 @@ do_load_file(GConfEngine* conf, LoadType load_type, gboolean unload, const gchar
}
return 0;
-
-#undef LOAD_TYPE_TO_LIST
-#undef LOAD_TYPE_TO_ROOT
}
static int
do_makefile_install(GConfEngine* conf, const gchar** args, gboolean unload)
{
- GError* err = NULL;
-
if (args == NULL)
{
g_printerr (_("Must specify some schema files to install\n"));
@@ -3727,17 +3738,7 @@ do_makefile_install(GConfEngine* conf, const gchar** args, gboolean unload)
++args;
}
- gconf_engine_suggest_sync(conf, &err);
-
- if (err != NULL)
- {
- g_printerr (_("Error syncing config data: %s"),
- err->message);
- g_error_free(err);
- return 1;
- }
-
- return 0;
+ return do_sync (conf);
}
typedef enum {