mirror of
https://github.com/etesync/android
synced 2024-12-24 23:48:35 +00:00
Handle Android "INTEGER (boolean)" values which are read as CharSequences correctly (fixes #503)
This commit is contained in:
parent
8fc86dd12c
commit
011dd15c98
@ -201,7 +201,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
ContentValues values = e.getEntityValues();
|
ContentValues values = e.getEntityValues();
|
||||||
c.setUid(values.getAsString(entryColumnUID()));
|
c.setUid(values.getAsString(entryColumnUID()));
|
||||||
c.setUnknownProperties(values.getAsString(COLUMN_UNKNOWN_PROPERTIES));
|
c.setUnknownProperties(values.getAsString(COLUMN_UNKNOWN_PROPERTIES));
|
||||||
c.setStarred(values.getAsBoolean(RawContacts.STARRED));
|
c.setStarred(values.getAsInteger(RawContacts.STARRED) != 0);
|
||||||
|
|
||||||
List<Entity.NamedContentValues> subValues = e.getSubValues();
|
List<Entity.NamedContentValues> subValues = e.getSubValues();
|
||||||
for (Entity.NamedContentValues subValue : subValues) {
|
for (Entity.NamedContentValues subValue : subValues) {
|
||||||
@ -342,7 +342,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
if (StringUtils.isNotEmpty(customType))
|
if (StringUtils.isNotEmpty(customType))
|
||||||
number.addType(TelephoneType.get(labelToXName(customType)));
|
number.addType(TelephoneType.get(labelToXName(customType)));
|
||||||
}
|
}
|
||||||
if (row.getAsBoolean(Phone.IS_PRIMARY))
|
if (row.getAsInteger(Phone.IS_PRIMARY) != 0)
|
||||||
number.addType(TelephoneType.PREF);
|
number.addType(TelephoneType.PREF);
|
||||||
c.getPhoneNumbers().add(number);
|
c.getPhoneNumbers().add(number);
|
||||||
}
|
}
|
||||||
@ -364,7 +364,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
if (StringUtils.isNotEmpty(customType))
|
if (StringUtils.isNotEmpty(customType))
|
||||||
email.addType(EmailType.get(labelToXName(customType)));
|
email.addType(EmailType.get(labelToXName(customType)));
|
||||||
}
|
}
|
||||||
if (row.getAsBoolean(Email.IS_PRIMARY))
|
if (row.getAsInteger(Email.IS_PRIMARY) != 0)
|
||||||
email.addType(EmailType.PREF);
|
email.addType(EmailType.PREF);
|
||||||
c.getEmails().add(email);
|
c.getEmails().add(email);
|
||||||
}
|
}
|
||||||
|
@ -342,7 +342,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
|||||||
e.setLocation(values.getAsString(Events.EVENT_LOCATION));
|
e.setLocation(values.getAsString(Events.EVENT_LOCATION));
|
||||||
e.setDescription(values.getAsString(Events.DESCRIPTION));
|
e.setDescription(values.getAsString(Events.DESCRIPTION));
|
||||||
|
|
||||||
final boolean allDay = values.getAsBoolean(Events.ALL_DAY);
|
final boolean allDay = values.getAsInteger(Events.ALL_DAY) != 0;
|
||||||
final long tsStart = values.getAsLong(Events.DTSTART);
|
final long tsStart = values.getAsLong(Events.DTSTART);
|
||||||
final String duration = values.getAsString(Events.DURATION);
|
final String duration = values.getAsString(Events.DURATION);
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
|||||||
if (values.containsKey(Events.ORIGINAL_INSTANCE_TIME)) {
|
if (values.containsKey(Events.ORIGINAL_INSTANCE_TIME)) {
|
||||||
// this event is an exception of a recurring event
|
// this event is an exception of a recurring event
|
||||||
long originalInstanceTime = values.getAsLong(Events.ORIGINAL_INSTANCE_TIME);
|
long originalInstanceTime = values.getAsLong(Events.ORIGINAL_INSTANCE_TIME);
|
||||||
boolean originalAllDay = values.getAsBoolean(Events.ORIGINAL_ALL_DAY);
|
boolean originalAllDay = values.getAsInteger(Events.ORIGINAL_ALL_DAY) != 0;
|
||||||
Date originalDate = originalAllDay ?
|
Date originalDate = originalAllDay ?
|
||||||
new Date(originalInstanceTime) :
|
new Date(originalInstanceTime) :
|
||||||
new DateTime(originalInstanceTime);
|
new DateTime(originalInstanceTime);
|
||||||
@ -430,7 +430,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
|||||||
e.setOpaque(values.getAsInteger(Events.AVAILABILITY) != Events.AVAILABILITY_FREE);
|
e.setOpaque(values.getAsInteger(Events.AVAILABILITY) != Events.AVAILABILITY_FREE);
|
||||||
|
|
||||||
// set ORGANIZER only when there are attendees
|
// set ORGANIZER only when there are attendees
|
||||||
if (values.getAsBoolean(Events.HAS_ATTENDEE_DATA) && values.containsKey(Events.ORGANIZER))
|
if (values.getAsInteger(Events.HAS_ATTENDEE_DATA) != 0 && values.containsKey(Events.ORGANIZER))
|
||||||
try {
|
try {
|
||||||
e.setOrganizer(new Organizer(new URI("mailto", values.getAsString(Events.ORGANIZER), null)));
|
e.setOrganizer(new Organizer(new URI("mailto", values.getAsString(Events.ORGANIZER), null)));
|
||||||
} catch (URISyntaxException ex) {
|
} catch (URISyntaxException ex) {
|
||||||
|
@ -126,7 +126,7 @@ verschillende mensen die worden genoemd in hun respectieve taal versie.</p>
|
|||||||
<string name="settings_sync_summary_manually">Alleen handmatig</string>
|
<string name="settings_sync_summary_manually">Alleen handmatig</string>
|
||||||
<string name="settings_sync_summary_periodically">Elke %d minuten + meteen na wijziging</string>
|
<string name="settings_sync_summary_periodically">Elke %d minuten + meteen na wijziging</string>
|
||||||
<string name="settings_sync_summary_not_available">Niet beschikbaar</string>
|
<string name="settings_sync_summary_not_available">Niet beschikbaar</string>
|
||||||
<string name="settings_sync_interval_calendars">Agenda's verversen</string>
|
<string name="settings_sync_interval_calendars">Agenda\'s verversen</string>
|
||||||
<string-array name="settings_sync_interval_seconds">
|
<string-array name="settings_sync_interval_seconds">
|
||||||
<item>-1</item>
|
<item>-1</item>
|
||||||
<item>300</item>
|
<item>300</item>
|
||||||
@ -158,9 +158,9 @@ verschillende mensen die worden genoemd in hun respectieve taal versie.</p>
|
|||||||
<string name="setup_querying_server">Gegevens worden aangevraagd. Even geduld…</string>
|
<string name="setup_querying_server">Gegevens worden aangevraagd. Even geduld…</string>
|
||||||
<string name="setup_what_to_sync">Welke collecties wilt u synchronizereen ?</string>
|
<string name="setup_what_to_sync">Welke collecties wilt u synchronizereen ?</string>
|
||||||
<string name="setup_address_books">Adresboeken</string>
|
<string name="setup_address_books">Adresboeken</string>
|
||||||
<string name="setup_calendars">Agenda's</string>
|
<string name="setup_calendars">Agenda\'s</string>
|
||||||
<string name="setup_select_address_book">Selecteer maximaal 1 adresboek (tap opnieuw om te deselecteren):</string>
|
<string name="setup_select_address_book">Selecteer maximaal 1 adresboek (tap opnieuw om te deselecteren):</string>
|
||||||
<string name="setup_select_calendars">Selecteer uw agend's:</string>
|
<string name="setup_select_calendars">Selecteer uw agend\'s:</string>
|
||||||
|
|
||||||
<string name="setup_account_details">Account eigenschappen</string>
|
<string name="setup_account_details">Account eigenschappen</string>
|
||||||
<string name="setup_account_name">Account naam:</string>
|
<string name="setup_account_name">Account naam:</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user