Tasks without due dates shouldn't be added to calendar

pull/14/head
Sam Bosley 12 years ago
parent 6b5694fab9
commit 30e0f77180

@ -135,6 +135,9 @@ public class GCalControlSet extends PopupControlSet {
@SuppressWarnings("nls")
@Override
protected String writeToModelAfterInitialized(Task task) {
if (!task.hasDueDate())
return null;
boolean gcalCreateEventEnabled = Preferences.getStringValue(R.string.gcal_p_default) != null &&
!Preferences.getStringValue(R.string.gcal_p_default).equals("-1");
if ((gcalCreateEventEnabled || calendarSelector.getSelectedItemPosition() != 0) &&

@ -45,10 +45,12 @@ public class GCalHelper {
}
public static void createTaskEventIfEnabled(Task t) {
if (!t.hasDueDate())
return;
createTaskEventIfEnabled(t, true);
}
public static void createTaskEventIfEnabled(Task t, boolean deleteEventIfExists) {
private static void createTaskEventIfEnabled(Task t, boolean deleteEventIfExists) {
boolean gcalCreateEventEnabled = Preferences.getStringValue(R.string.gcal_p_default) != null
&& !Preferences.getStringValue(R.string.gcal_p_default).equals("-1"); //$NON-NLS-1$
if (gcalCreateEventEnabled) {

@ -358,7 +358,7 @@ public class QuickAddBar extends LinearLayout {
private static void addToCalendar(Task task, String title) {
boolean gcalCreateEventEnabled = Preferences.getStringValue(R.string.gcal_p_default) != null
&& !Preferences.getStringValue(R.string.gcal_p_default).equals("-1"); //$NON-NLS-1$
&& !Preferences.getStringValue(R.string.gcal_p_default).equals("-1") && task.hasDueDate(); //$NON-NLS-1$
if (!TextUtils.isEmpty(title) && gcalCreateEventEnabled && TextUtils.isEmpty(task.getValue(Task.CALENDAR_URI))) {
Uri calendarUri = GCalHelper.createTaskEvent(task,

Loading…
Cancel
Save