[gnome-contacts/new-design] Support FakePersona in Contact.set_persona_property
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts/new-design] Support FakePersona in Contact.set_persona_property
- Date: Thu, 15 Dec 2011 09:38:05 +0000 (UTC)
commit c92e9d78b7dde09b84e6d786545b6eee47e468ae
Author: Alexander Larsson <alexl redhat com>
Date: Tue Dec 13 14:41:20 2011 +0100
Support FakePersona in Contact.set_persona_property
src/contacts-contact.vala | 47 ++++++++++++++++++++++++--------------------
1 files changed, 26 insertions(+), 21 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index f70d4c5..9ac8e0c 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -1054,70 +1054,75 @@ public class Contacts.Contact : GLib.Object {
}
internal static async void set_persona_property (Persona persona,
- string property_name, Value new_value) throws PropertyError {
+ string property_name, Value new_value) throws PropertyError {
+ if (persona is FakePersona) {
+ var fake = persona as FakePersona;
+ yield fake.make_real_and_set (property_name, new_value);
+ }
+
/* FIXME: It should be possible to move these all to being delegates which are
* passed to the functions which currently call this one; but only once bgo#604827 is fixed. */
switch (property_name) {
case "alias":
yield (persona as AliasDetails).change_alias ((string) new_value);
- return;
+ break;
case "avatar":
yield (persona as AvatarDetails).change_avatar ((LoadableIcon?) new_value);
- return;
+ break;
case "birthday":
yield (persona as BirthdayDetails).change_birthday ((DateTime?) new_value);
- return;
+ break;
case "calendar-event-id":
yield (persona as BirthdayDetails).change_calendar_event_id ((string?) new_value);
- return;
+ break;
case "email-addresses":
yield (persona as EmailDetails).change_email_addresses ((Set<EmailFieldDetails>) new_value);
- return;
+ break;
case "is-favourite":
yield (persona as FavouriteDetails).change_is_favourite ((bool) new_value);
- return;
+ break;
case "gender":
yield (persona as GenderDetails).change_gender ((Gender) new_value);
- return;
+ break;
case "groups":
yield (persona as GroupDetails).change_groups ((Set<string>) new_value);
- return;
+ break;
case "im-addresses":
yield (persona as ImDetails).change_im_addresses ((MultiMap<string, ImFieldDetails>) new_value);
- return;
+ break;
case "local-ids":
yield (persona as LocalIdDetails).change_local_ids ((Set<string>) new_value);
- return;
+ break;
case "structured-name":
yield (persona as NameDetails).change_structured_name ((StructuredName?) new_value);
- return;
+ break;
case "full-name":
yield (persona as NameDetails).change_full_name ((string) new_value);
- return;
+ break;
case "nickname":
yield (persona as NameDetails).change_nickname ((string) new_value);
- return;
+ break;
case "notes":
yield (persona as NoteDetails).change_notes ((Set<NoteFieldDetails>) new_value);
- return;
+ break;
case "phone-numbers":
yield (persona as PhoneDetails).change_phone_numbers ((Set<PhoneFieldDetails>) new_value);
- return;
+ break;
case "postal-addresses":
yield (persona as PostalAddressDetails).change_postal_addresses ((Set<PostalAddressFieldDetails>) new_value);
- return;
+ break;
case "roles":
yield (persona as RoleDetails).change_roles ((Set<RoleFieldDetails>) new_value);
- return;
+ break;
case "urls":
yield (persona as UrlDetails).change_urls ((Set<UrlFieldDetails>) new_value);
- return;
+ break;
case "web-service-addresses":
yield (persona as WebServiceDetails).change_web_service_addresses ((MultiMap<string, WebServiceFieldDetails>) new_value);
- return;
+ break;
default:
critical ("Unknown property '%s' in Contact.set_persona_property().", property_name);
- return;
+ break;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]