Force queries in date migrator to happen right away

pull/14/head
Sam Bosley 13 years ago
parent 81b062de41
commit 9f94a5dd80

@ -41,9 +41,11 @@ public class DueDateTimeMigrator {
Criterion.and(Task.DUE_DATE.gt(0), Criterion.and(Task.DUE_DATE.gt(0),
Functions.strftime(Task.DUE_DATE, STRFTIME_FORMAT).eq(LEGACY_NO_TIME_STRING)))); Functions.strftime(Task.DUE_DATE, STRFTIME_FORMAT).eq(LEGACY_NO_TIME_STRING))));
tasksWithoutDueTime.getCount();
tasksWithDueTime.getCount();
try { try {
// Set tasks without time to 12:00:00 // Set tasks without time to 12:00:00
System.err.println("Processing tasks without due time");
processCursor(tasksWithoutDueTime, new TaskDateAdjuster() { processCursor(tasksWithoutDueTime, new TaskDateAdjuster() {
@Override @Override
public void adjust(Date date) { public void adjust(Date date) {
@ -58,7 +60,6 @@ public class DueDateTimeMigrator {
} }
// Set tasks with time to have time HH:MM:01 // Set tasks with time to have time HH:MM:01
System.err.println("Processing tasks with due time");
processCursor(tasksWithDueTime, new TaskDateAdjuster() { processCursor(tasksWithDueTime, new TaskDateAdjuster() {
@Override @Override
public void adjust(Date date) { public void adjust(Date date) {
@ -78,7 +79,6 @@ public class DueDateTimeMigrator {
Task curr = new Task(); Task curr = new Task();
for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) { for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
curr.readFromCursor(cursor); curr.readFromCursor(cursor);
System.err.println("Processing task: " + curr.getValue(Task.TITLE));
long time = curr.getValue(Task.DUE_DATE) / 1000L * 1000L; long time = curr.getValue(Task.DUE_DATE) / 1000L * 1000L;
Date date = new Date(time); Date date = new Date(time);
adjuster.adjust(date); adjuster.adjust(date);

Loading…
Cancel
Save