aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/e-card-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/ebook/e-card-simple.c')
-rw-r--r--addressbook/backend/ebook/e-card-simple.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index 713b587cb2..f41c4f0cb5 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -240,10 +240,8 @@ e_card_simple_new (ECard *card)
ECardSimple *
e_card_simple_duplicate(ECardSimple *simple)
{
- char *vcard = e_card_simple_get_vcard(simple);
- ECard *card = e_card_new(vcard);
+ ECard *card = simple->card ? e_card_duplicate (simple->card) : e_card_new ("");
ECardSimple *new_simple = e_card_simple_new(card);
- g_free (vcard);
return new_simple;
}
@@ -293,6 +291,21 @@ e_card_simple_get_vcard (ECardSimple *simple)
return g_strdup("");
}
+/**
+ * e_card_simple_get_vcard_assume_utf8:
+ * @simple: an #ECardSimple
+ *
+ * Returns: a string in vcard format, which is wrapped by the @simple.
+ */
+char *
+e_card_simple_get_vcard_assume_utf8 (ECardSimple *simple)
+{
+ if (simple->card)
+ return e_card_get_vcard_assume_utf8(simple->card);
+ else
+ return g_strdup("");
+}
+
static void
e_card_simple_class_init (ECardSimpleClass *klass)
{