aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-13 03:29:27 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-13 03:29:27 +0800
commit12cd9f731c24cd5aea164737584d1f19568e48d7 (patch)
tree0fba83b325f81e4ac32657ccae925662b5f66562
parenta04cc4c8349cc8414a4f639a888cec84cd54929b (diff)
downloadgsoc2013-evolution-12cd9f731c24cd5aea164737584d1f19568e48d7.tar
gsoc2013-evolution-12cd9f731c24cd5aea164737584d1f19568e48d7.tar.gz
gsoc2013-evolution-12cd9f731c24cd5aea164737584d1f19568e48d7.tar.bz2
gsoc2013-evolution-12cd9f731c24cd5aea164737584d1f19568e48d7.tar.lz
gsoc2013-evolution-12cd9f731c24cd5aea164737584d1f19568e48d7.tar.xz
gsoc2013-evolution-12cd9f731c24cd5aea164737584d1f19568e48d7.tar.zst
gsoc2013-evolution-12cd9f731c24cd5aea164737584d1f19568e48d7.zip
Added a boolean type here.
2001-10-12 Christopher James Lahey <clahey@ximian.com> * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h: Added a boolean type here. svn path=/trunk/; revision=13624
-rw-r--r--addressbook/ChangeLog5
-rw-r--r--addressbook/backend/ebook/e-card-simple.c29
-rw-r--r--addressbook/backend/ebook/e-card-simple.h1
3 files changed, 35 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 4cc68a114f..2c1e7acd39 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-12 Christopher James Lahey <clahey@ximian.com>
+
+ * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
+ Added a boolean type here.
+
2001-10-12 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names.c
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 {