aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-card-simple.c29
-rw-r--r--addressbook/backend/ebook/e-card-simple.h1
2 files changed, 30 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index 2ef73e17f6..5fefbafd65 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -36,6 +36,7 @@ enum _ECardSimpleInternalType {
E_CARD_SIMPLE_INTERNAL_TYPE_PHONE,
E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL,
E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL,
+ E_CARD_SIMPLE_INTERNAL_TYPE_BOOL,
};
struct _ECardSimpleFieldData {
@@ -793,6 +794,19 @@ char *e_card_simple_get (ECardSimple *simple,
string = e_card_simple_get_email(simple,
field_data[field].list_type_index);
return g_strdup(string);
+ case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
+ if (simple->card) {
+ gboolean boole;
+ gtk_object_get (GTK_OBJECT (simple->card),
+ field_data[field].ecard_field, &boole,
+ NULL);
+ if (boole)
+ return "true";
+ else
+ return NULL;
+ } else {
+ return NULL;
+ }
case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
switch (field) {
case E_CARD_SIMPLE_FIELD_NAME_OR_ORG:
@@ -1028,6 +1042,18 @@ void e_card_simple_set (ECardSimple *simple,
break;
case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
break;
+ case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
+ if (simple->card) {
+ gboolean boole = TRUE;
+ if (data == NULL)
+ boole = FALSE;
+ else if (strcasecmp (data, "false"))
+ boole = FALSE;
+ gtk_object_set (GTK_OBJECT (simple->card),
+ field_data[field].ecard_field, boole,
+ NULL);
+ }
+ break;
}
break;
}
@@ -1045,6 +1071,9 @@ ECardSimpleType e_card_simple_type (ECardSimple *simple,
default:
return E_CARD_SIMPLE_TYPE_STRING;
+ case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
+ return E_CARD_SIMPLE_TYPE_BOOL;
+
case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
return E_CARD_SIMPLE_TYPE_DATE;
diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h
index 1639e4d71b..886a859928 100644
--- a/addressbook/backend/ebook/e-card-simple.h
+++ b/addressbook/backend/ebook/e-card-simple.h
@@ -73,6 +73,7 @@ enum _ECardSimpleAddressId {
enum _ECardSimpleType {
E_CARD_SIMPLE_TYPE_STRING,
E_CARD_SIMPLE_TYPE_DATE,
+ E_CARD_SIMPLE_TYPE_BOOL,
};
enum _ECardSimpleField {