From d73ed12816c6025524b8f1afc6e4eec917826f06 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 9 Apr 2012 18:39:08 -0700 Subject: [PATCH] Don't let title parsing override quickadd control sets --- astrid/src/com/todoroo/astrid/ui/QuickAddBar.java | 2 +- astrid/src/com/todoroo/astrid/utility/TitleParser.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java b/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java index b894ab2d3..de4babfe4 100644 --- a/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java +++ b/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java @@ -272,7 +272,7 @@ public class QuickAddBar extends LinearLayout { if (repeatControl.isRecurrenceSet()) repeatControl.writeToModel(task); - if (deadlineControl.isDeadlineSet()) { // Need to redo hide until using defaults in case it was set by some markup magic + if (deadlineControl.isDeadlineSet()) { task.clearValue(Task.HIDE_UNTIL); deadlineControl.writeToModel(task); TaskDao.createDefaultHideUntil(task); diff --git a/astrid/src/com/todoroo/astrid/utility/TitleParser.java b/astrid/src/com/todoroo/astrid/utility/TitleParser.java index 31d930c46..609383318 100644 --- a/astrid/src/com/todoroo/astrid/utility/TitleParser.java +++ b/astrid/src/com/todoroo/astrid/utility/TitleParser.java @@ -137,6 +137,8 @@ public class TitleParser { //Day of week (e.g. Monday, Tuesday,..) is overridden by a set date (e.g. October 23 2013). //Vague times (e.g. breakfast, night) are overridden by a set time (9 am, at 10, 17:00) private static boolean dayHelper(Task task ) { + if (task.containsNonNullValue(Task.DUE_DATE)) + return false; String inputText = task.getValue(Task.TITLE); Calendar cal = null; Boolean containsSpecificTime = false; @@ -336,6 +338,8 @@ public class TitleParser { //Parses through the text and sets the frequency of the task. private static boolean repeatHelper(Task task) { + if (task.containsNonNullValue(Task.RECURRENCE)) + return false; String inputText = task.getValue(Task.TITLE); HashMap repeatTimes = new HashMap(); repeatTimes.put("(?i)\\bevery ?\\w{0,6} days?\\b" , Frequency.DAILY);