mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
SaveCalendar: reuse property factory
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
8e751eedab
commit
9ab052d379
1 changed files with 4 additions and 3 deletions
|
@ -60,6 +60,7 @@ import net.fortuna.ical4j.model.DateTime;
|
||||||
import net.fortuna.ical4j.model.Dur;
|
import net.fortuna.ical4j.model.Dur;
|
||||||
import net.fortuna.ical4j.model.Period;
|
import net.fortuna.ical4j.model.Period;
|
||||||
import net.fortuna.ical4j.model.Property;
|
import net.fortuna.ical4j.model.Property;
|
||||||
|
import net.fortuna.ical4j.model.PropertyFactoryImpl;
|
||||||
import net.fortuna.ical4j.model.PropertyFactoryRegistry;
|
import net.fortuna.ical4j.model.PropertyFactoryRegistry;
|
||||||
import net.fortuna.ical4j.model.PropertyList;
|
import net.fortuna.ical4j.model.PropertyList;
|
||||||
import net.fortuna.ical4j.model.TimeZone;
|
import net.fortuna.ical4j.model.TimeZone;
|
||||||
|
@ -103,7 +104,7 @@ import java.util.UUID;
|
||||||
public class SaveCalendar {
|
public class SaveCalendar {
|
||||||
private static final String TAG = "ICS_SaveCalendar";
|
private static final String TAG = "ICS_SaveCalendar";
|
||||||
|
|
||||||
//private final PropertyFactoryImpl mPropertyFactory = new PropertyFactoryRegistry()
|
private final PropertyFactoryImpl mPropertyFactory = new PropertyFactoryRegistry();
|
||||||
private TimeZoneRegistry mTzRegistry;
|
private TimeZoneRegistry mTzRegistry;
|
||||||
private final Set<TimeZone> mInsertedTimeZones = new HashSet<>();
|
private final Set<TimeZone> mInsertedTimeZones = new HashSet<>();
|
||||||
private final Set<String> mFailedOrganisers = new HashSet<>();
|
private final Set<String> mFailedOrganisers = new HashSet<>();
|
||||||
|
@ -553,7 +554,7 @@ public class SaveCalendar {
|
||||||
try {
|
try {
|
||||||
String value = getString(cur, dbName);
|
String value = getString(cur, dbName);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
Property p = new PropertyFactoryRegistry().createProperty(evName);
|
Property p = mPropertyFactory.createProperty(evName);
|
||||||
p.setValue(value);
|
p.setValue(value);
|
||||||
l.add(p);
|
l.add(p);
|
||||||
return value;
|
return value;
|
||||||
|
@ -571,7 +572,7 @@ public class SaveCalendar {
|
||||||
if (i != -1 && !cur.isNull(i)) {
|
if (i != -1 && !cur.isNull(i)) {
|
||||||
int value = (int) cur.getLong(i);
|
int value = (int) cur.getLong(i);
|
||||||
if (value >= 0 && value < vals.size() && vals.get(value) != null) {
|
if (value >= 0 && value < vals.size() && vals.get(value) != null) {
|
||||||
Property p = new PropertyFactoryRegistry().createProperty(evName);
|
Property p = mPropertyFactory.createProperty(evName);
|
||||||
p.setValue(vals.get(value));
|
p.setValue(vals.get(value));
|
||||||
l.add(p);
|
l.add(p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue