aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-migrate.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-03-21 01:23:58 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-03-21 01:23:58 +0800
commitcba3097cad7443810117bded371a2e3088a33d12 (patch)
treeb4bf9ba6b6c9b5433c8ac2614694d7bf76d87ff0 /mail/em-migrate.c
parent2313e47dab3e8151743138892277b08cf78034cc (diff)
downloadgsoc2013-evolution-cba3097cad7443810117bded371a2e3088a33d12.tar.gz
gsoc2013-evolution-cba3097cad7443810117bded371a2e3088a33d12.tar.zst
gsoc2013-evolution-cba3097cad7443810117bded371a2e3088a33d12.zip
** Fixes bug #419524
2007-03-20 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #419524 * Include <glib/gi18n.h> instead of <libgnome/gnome-i18n.h>. * e-util/e-xml-utils.c (e_xml_get_child_by_name_by_lang_list): * mail/em-migrate.c (emm_setup_initial): * shell/e-component-registry.c (query_components): * shell/e-shell-settings-dialog.c (load_pages): * shell/e-shell-window-commands.c (command_quick_reference): * tools/killev.c (main): Use g_get_language_names() instead of gnome_i18n_get_language_list(). * e-util/e-util.c: Remove e_gettext(). * e-util/Makefile.am: Remove e-i18n.h. svn path=/trunk/; revision=33319
Diffstat (limited to 'mail/em-migrate.c')
-rw-r--r--mail/em-migrate.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 723561ec21..85887fb5e4 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -54,7 +54,7 @@
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>
-#include <libgnome/gnome-i18n.h>
+#include <glib/gi18n.h>
#include <e-util/e-util.h>
#include <libedataserver/e-data-server-util.h>
@@ -2645,38 +2645,33 @@ emm_setup_initial(const char *evolution_dir)
{
GDir *dir;
const char *d;
- struct stat st;
- const GList *l;
char *local, *base;
+ const gchar * const *language_names;
/* special-case - this means brand new install of evolution */
/* FIXME: create default folders and stuff... */
d(printf("Setting up initial mail tree\n"));
- base = g_build_filename(evolution_dir, "mail/local", NULL);
+ base = g_build_filename(evolution_dir, "mail", "local", NULL);
if (e_util_mkdir_hier(base, 0777) == -1 && errno != EEXIST) {
g_free(base);
return -1;
}
/* e.g. try en-AU then en, etc */
- for (l = gnome_i18n_get_language_list("LC_MESSAGES");
- l != NULL;
- l = g_list_next(l)) {
- local = g_build_filename(EVOLUTION_PRIVDATADIR,
- "default",
- (char *)l->data,
- "mail/local", NULL);
- if (g_stat(local, &st) == 0)
- goto gotlocal;
-
- g_free(local);
- }
-
- local = g_build_filename(EVOLUTION_PRIVDATADIR,
- "default/C/mail/local", NULL);
-gotlocal:
+ language_names = g_get_language_names ();
+ while (*language_names != NULL) {
+ local = g_build_filename (
+ EVOLUTION_PRIVDATADIR, "default",
+ *language_names++, "mail", "local", NULL);
+ if (g_file_test (local, G_FILE_TEST_EXISTS))
+ break;
+ g_free (local);
+ }
+
+ /* Make sure we found one. */
+ g_assert (*language_names != NULL);
dir = g_dir_open(local, 0, NULL);
if (dir) {