2 * Copyright (C) 2009 Collabora Ltd.
4 * This library 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.1 of the License, or (at your option) any later version.
9 * This library 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 this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 * Authors: Jonny Lamb <jonny.lamb@collabora.co.uk>
19 * Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
22 #include <telepathy-glib/util.h>
24 #include <libempathy/empathy-utils.h>
26 #include "empathy-import-utils.h"
27 #include "empathy-import-pidgin.h"
29 EmpathyImportAccountData *
30 empathy_import_account_data_new (const gchar *source)
32 EmpathyImportAccountData *data;
34 g_return_val_if_fail (!EMP_STR_EMPTY (source), NULL);
36 data = g_slice_new0 (EmpathyImportAccountData);
37 data->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL,
38 (GDestroyNotify) tp_g_value_slice_free);
39 data->source = g_strdup (source);
40 data->protocol = NULL;
41 data->connection_manager = NULL;
47 empathy_import_account_data_free (EmpathyImportAccountData *data)
51 if (data->protocol != NULL)
52 g_free (data->protocol);
53 if (data->connection_manager != NULL)
54 g_free (data->connection_manager);
55 if (data->settings != NULL)
56 g_hash_table_destroy (data->settings);
57 if (data->source != NULL)
58 g_free (data->source);
60 g_slice_free (EmpathyImportAccountData, data);
64 empathy_import_accounts_to_import (void)
66 return empathy_import_pidgin_accounts_to_import ();
70 empathy_import_accounts_load (EmpathyImportApplication id)
72 if (id == EMPATHY_IMPORT_APPLICATION_PIDGIN)
73 return empathy_import_pidgin_load ();
75 return empathy_import_pidgin_load ();