[l10n] Updated Estonian translation
[bug-buddy.git] / src / eds-buddy.c
blob5e37be90517919b4be29aede16e90798d8388cb3
1 /* bug-buddy bug submitting program
3 * Copyright (C) 2006 Fernando Herrera
5 * Author: Fernando Herrera <fherrera@onirica.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU General Public
9 * License as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21 #include <string.h>
22 #include <config.h>
24 #include <glib.h>
25 #include <gconf/gconf-client.h>
27 #ifdef ENABLE_EDS
28 #include <libebook/e-book.h>
29 #endif
31 #include "eds-buddy.h"
33 char*
34 get_default_user_email (void)
36 GConfClient *conf_client;
37 char *tmp;
38 #ifdef ENABLE_EDS
39 EBook *book;
40 EContact *me = NULL;
41 #endif
43 conf_client = gconf_client_get_default ();
44 tmp = gconf_client_get_string (conf_client, "/apps/bug-buddy/email_address", NULL);
45 g_object_unref (conf_client);
47 if (tmp != NULL && strlen (tmp) > 0)
48 return tmp;
50 #ifdef ENABLE_EDS
51 e_book_get_self (&me, &book, NULL);
52 if (me == NULL)
53 return NULL;
55 tmp = e_contact_get (me, E_CONTACT_EMAIL_2);
56 if (tmp != NULL && strlen (tmp) > 0)
57 return tmp;
59 tmp = e_contact_get (me, E_CONTACT_EMAIL_1);
60 if (tmp != NULL && strlen (tmp) > 0)
61 return tmp;
62 #endif
64 return NULL;