4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
22 #include <glib/gi18n.h>
24 #include <libebackend/libebackend.h>
26 /* Forward Declarations */
27 void evolution_source_registry_migrate_basedir (void);
28 void evolution_source_registry_migrate_sources (void);
35 EDBusServerExitCode exit_code;
38 setlocale (LC_ALL, "");
39 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
40 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
45 /* Migrate user data from ~/.evolution to XDG base directories. */
46 evolution_source_registry_migrate_basedir ();
48 /* Migrate ESource data from GConf XML blobs to key files.
49 * Do this AFTER XDG base directory migration since the key
50 * files are saved according to XDG base directory settings. */
51 evolution_source_registry_migrate_sources ();
53 server = e_source_registry_server_new ();
55 /* Failure here is fatal. Don't even try to keep going. */
56 e_source_registry_server_load_all (
57 E_SOURCE_REGISTRY_SERVER (server), &error);
60 g_printerr ("%s\n", error->message);
61 g_object_unref (server);
65 g_print ("Server is up and running...\n");
67 /* Keep the server from quitting on its own.
68 * We don't have a way of tracking number of
69 * active clients, so once the server is up,
70 * it's up until the session bus closes. */
71 e_dbus_server_hold (server);
73 exit_code = e_dbus_server_run (server, FALSE);
75 g_object_unref (server);
77 if (exit_code == E_DBUS_SERVER_EXIT_RELOAD) {
78 g_print ("Reloading...\n");