From 27465de81b10affba64d38e7cc13ec8300ed32d0 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 30 Nov 2011 22:45:01 +1300 Subject: [PATCH] Allow an instance of PropertyName to be set to an arbitrary value. --- src/com/morphoss/acal/Constants.java | 8 ++++---- src/com/morphoss/acal/davacal/PropertyName.java | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/com/morphoss/acal/Constants.java b/src/com/morphoss/acal/Constants.java index c95a16f..77d6e89 100755 --- a/src/com/morphoss/acal/Constants.java +++ b/src/com/morphoss/acal/Constants.java @@ -40,18 +40,18 @@ public class Constants { public static final long SERVICE_WORKER_GRACE_PERIOD = 1000*60*60*1; //Amount of time we will allow worker to be 'late' before assuming its hung /** Generally useful patterns */ - public static final Pattern lineSplitter = Pattern.compile("\r?\n"); - public static final Pattern rfc5545UnWrapper = Pattern.compile("\r?\n "); + public static final Pattern lineSplitter = Pattern.compile("\\r?\\n"); + public static final Pattern rfc5545UnWrapper = Pattern.compile("\r?\n ",Pattern.DOTALL); public static final Pattern tzOlsonExtractor = Pattern.compile(".*((?:Antarctica|America|Africa|Atlantic|Asia|Australia|Indian|Europe|Pacific|US)/(?:(?:[^/\"]+)/)?[^/\"]+)\"?"); public final static Pattern splitOnCommas = Pattern.compile(","); public static final Pattern matchSegmentName = Pattern.compile("([^/]+)$"); /** Set this to false and all debug logging is turned off */ - public static final boolean DEBUG_MODE = true; + public static final boolean DEBUG_MODE = false; /** How much stuff to spit out into the logs */ public static final boolean LOG_VERBOSE = false && DEBUG_MODE; //Very verbose play by play execution information - public static final boolean LOG_DEBUG = true && DEBUG_MODE; //Information relevant to debugging tasks. + public static final boolean LOG_DEBUG = false && DEBUG_MODE; //Information relevant to debugging tasks. public static final boolean DEBUG_SETTINGS = true && DEBUG_MODE; // Does the debugging menu appear in Settings /** Since Andrew's device won't display logs at DEBUG level he needs a way to fake that! */ diff --git a/src/com/morphoss/acal/davacal/PropertyName.java b/src/com/morphoss/acal/davacal/PropertyName.java index e95845c..c2d8eca 100644 --- a/src/com/morphoss/acal/davacal/PropertyName.java +++ b/src/com/morphoss/acal/davacal/PropertyName.java @@ -4,11 +4,20 @@ public enum PropertyName { UID, DTSTAMP, CREATED, LAST_MODIFIED, DTSTART, DTEND, DUE, DURATION, LOCATION, SUMMARY, DESCRIPTION, RRULE, RDATE, EXDATE, PERCENT_COMPLETE, COMPLETED, STATUS, TRIGGER, ACTION, RECURRENCE_ID, INVALID; + + private String arbitraryName = null; public String toString() { + if ( arbitraryName != null ) return arbitraryName; return super.toString().replace('_', '-'); } + public static PropertyName arbitrary( String name ) { + PropertyName p = INVALID; + INVALID.arbitraryName = name; + return p; + } + /** * Returns a static array of the properties which can be localised with a TZID. * @return -- 2.11.4.GIT