~ubuntu-branches/ubuntu/wily/evolution-data-server/wily

« back to all changes in this revision

Viewing changes to services/evolution-source-registry/evolution-source-registry.c

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2015-07-20 13:34:59 UTC
  • mfrom: (1.1.126) (1.2.48 sid)
  • Revision ID: package-import@ubuntu.com-20150720133459-g6y46hnu5ewtoz08
Tags: 3.16.4-0ubuntu2
debian/patches/0001-Bug-752373-Monthly-events-do-not-recur-correctly.patch:
Cherry-pick patch from upstream to fix events not recurring correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * evolution-source-registry.c
3
3
 *
4
 
 * This library is free software you can redistribute it and/or modify it
 
4
 * This program is free software: you can redistribute it and/or modify it
5
5
 * under the terms of the GNU Lesser General Public License as published by
6
6
 * the Free Software Foundation.
7
7
 *
8
 
 * This library is distributed in the hope that it will be useful, but
 
8
 * This program is distributed in the hope that it will be useful, but
9
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 
10
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11
11
 * for more details.
12
12
 *
13
13
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this library; if not, see <http://www.gnu.org/licenses/>.
 
14
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 *
16
16
 */
17
17
 
24
24
#include <gtk/gtk.h>
25
25
#endif
26
26
 
 
27
#include <libedataserver/libedataserver.h>
27
28
#include <libebackend/libebackend.h>
28
29
 
29
30
#include "evolution-source-registry-resource.h"
144
145
        GOptionContext *context;
145
146
        EDBusServer *server;
146
147
        EDBusServerExitCode exit_code;
 
148
        GSettings *settings;
147
149
        GError *error = NULL;
148
150
 
 
151
#ifdef G_OS_WIN32
 
152
        e_util_win32_initialize ();
 
153
#endif
 
154
 
149
155
        setlocale (LC_ALL, "");
150
156
        bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
151
157
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
152
158
 
 
159
        /* Workaround https://bugzilla.gnome.org/show_bug.cgi?id=674885 */
 
160
        g_type_ensure (G_TYPE_DBUS_CONNECTION);
 
161
 
 
162
#if defined (ENABLE_MAINTAINER_MODE) && defined (HAVE_GTK)
 
163
        if (g_getenv ("EDS_TESTING") == NULL)
 
164
                /* This is only to load gtk-modules, like
 
165
                 * bug-buddy's gnomesegvhandler, if possible */
 
166
                gtk_init_check (&argc, &argv);
 
167
#endif
 
168
 
153
169
        context = g_option_context_new (NULL);
154
170
        g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
155
171
        g_option_context_parse (context, &argc, &argv, &error);
160
176
                exit (EXIT_FAILURE);
161
177
        }
162
178
 
163
 
#if defined (ENABLE_MAINTAINER_MODE) && defined (HAVE_GTK)
164
 
        if (g_getenv ("EDS_TESTING") == NULL)
165
 
                /* This is only to load gtk-modules, like
166
 
                 * bug-buddy's gnomesegvhandler, if possible */
167
 
                gtk_init_check (&argc, &argv);
168
 
#endif
169
 
 
170
179
        e_gdbus_templates_init_main_thread ();
171
180
 
172
181
reload:
173
182
 
174
 
        if (!opt_disable_migration) {
 
183
        settings = g_settings_new ("org.gnome.evolution-data-server");
 
184
 
 
185
        if (!opt_disable_migration && !g_settings_get_boolean (settings, "migrated")) {
 
186
                g_settings_set_boolean (settings, "migrated", TRUE);
 
187
 
175
188
                /* Migrate user data from ~/.evolution to XDG base directories. */
176
189
                evolution_source_registry_migrate_basedir ();
177
190
 
179
192
                 * Do this AFTER XDG base directory migration since the key
180
193
                 * files are saved according to XDG base directory settings. */
181
194
                evolution_source_registry_migrate_sources ();
 
195
        } else if (opt_disable_migration) {
 
196
                e_source_registry_debug_print (" * Skipping old account data migration, disabled on command line\n");
 
197
        } else {
 
198
                e_source_registry_debug_print (" * Skipping old account data migration, already migrated\n");
182
199
        }
183
200
 
 
201
        g_object_unref (settings);
 
202
 
184
203
        server = e_source_registry_server_new ();
185
204
 
186
205
        g_signal_connect (