Skip to content

Commit

Permalink
Remove unused Task columns
Browse files Browse the repository at this point in the history
  • Loading branch information
abaker committed Jul 7, 2014
1 parent 54fdd26 commit 5ea6054
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 55 deletions.
50 changes: 0 additions & 50 deletions api/src/main/java/com/todoroo/astrid/data/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ public class Task extends RemoteModel {
public static final LongProperty DETAILS_DATE = new LongProperty(
TABLE, "detailsDate", Property.PROP_FLAG_DATE);

@Deprecated
public static final IntegerProperty FLAGS = new IntegerProperty(
TABLE, "flags");

public static final IntegerProperty IS_READONLY = new IntegerProperty(
TABLE, "is_readonly", Property.PROP_FLAG_BOOLEAN);

// --- non-core task metadata

public static final StringProperty NOTES = new StringProperty(
Expand Down Expand Up @@ -125,11 +118,6 @@ public class Task extends RemoteModel {
public static final LongProperty REMINDER_LAST = new LongProperty(
TABLE, "lastNotified", Property.PROP_FLAG_DATE);

/** What kind of reminder the last reminder was: private task,
* social with no faces, social with faces */
public static final StringProperty SOCIAL_REMINDER = new StringProperty(
TABLE, "socialReminder");

/** Unixtime snooze is set (0 -> no snooze) */
public static final LongProperty REMINDER_SNOOZE = new LongProperty(
TABLE, "snoozeTime", Property.PROP_FLAG_DATE);
Expand All @@ -143,32 +131,12 @@ public class Task extends RemoteModel {
public static final StringProperty CALENDAR_URI = new StringProperty(
TABLE, "calendarUri");

public static final StringProperty CLASSIFICATION = new StringProperty(
TABLE, "classification");

// --- for astrid.com

/** Remote id */
public static final StringProperty UUID = new StringProperty(
TABLE, UUID_PROPERTY_NAME, Property.PROP_FLAG_NULLABLE);

/** Last Sync date */
@Deprecated
public static final LongProperty LAST_SYNC = new LongProperty(
TABLE, "lastSync", Property.PROP_FLAG_DATE);

/** Pushed at date */
public static final LongProperty PUSHED_AT = new LongProperty(
TABLE, PUSHED_AT_PROPERTY_NAME, Property.PROP_FLAG_DATE);

/** Attachments pushed at date */
public static final LongProperty ATTACHMENTS_PUSHED_AT = new LongProperty(
TABLE, "attachments_pushed_at", Property.PROP_FLAG_DATE);

/** User activities pushed at date */
public static final LongProperty USER_ACTIVITIES_PUSHED_AT = new LongProperty(
TABLE, "activities_pushed_at", Property.PROP_FLAG_DATE);

/** List of all properties for this model */
public static final Property<?>[] PROPERTIES = generateProperties(Task.class);

Expand All @@ -193,10 +161,6 @@ public class Task extends RemoteModel {
public static final int IMPORTANCE_SHOULD_DO = 2;
public static final int IMPORTANCE_NONE = 3;

// --- social reminder types

public static final String REMINDER_SOCIAL_UNSEEN = "unseen";

/**
* @return colors that correspond to importance values
*/
Expand Down Expand Up @@ -226,31 +190,21 @@ public static int[] getImportanceColors(Resources r) {
defaultValues.put(COMPLETION_DATE.name, 0);
defaultValues.put(DELETION_DATE.name, 0);
defaultValues.put(IMPORTANCE.name, IMPORTANCE_NONE);

defaultValues.put(CALENDAR_URI.name, "");
defaultValues.put(RECURRENCE.name, "");
defaultValues.put(REPEAT_UNTIL.name, 0L);
defaultValues.put(REMINDER_PERIOD.name, 0);
defaultValues.put(REMINDER_FLAGS.name, 0);
defaultValues.put(REMINDER_LAST.name, 0);
defaultValues.put(SOCIAL_REMINDER.name, REMINDER_SOCIAL_UNSEEN);
defaultValues.put(REMINDER_SNOOZE.name, 0);
defaultValues.put(ESTIMATED_SECONDS.name, 0);
defaultValues.put(ELAPSED_SECONDS.name, 0);
defaultValues.put(POSTPONE_COUNT.name, 0);
defaultValues.put(NOTES.name, "");
defaultValues.put(FLAGS.name, 0);
defaultValues.put(TIMER_START.name, 0);
defaultValues.put(DETAILS.name, (String)null);
defaultValues.put(DETAILS_DATE.name, 0);
defaultValues.put(IS_READONLY.name, 0);
defaultValues.put(CLASSIFICATION.name, "");

defaultValues.put(LAST_SYNC.name, 0);
defaultValues.put(UUID.name, NO_UUID);
defaultValues.put(PUSHED_AT.name, 0L);
defaultValues.put(ATTACHMENTS_PUSHED_AT.name, 0L);
defaultValues.put(USER_ACTIVITIES_PUSHED_AT.name, 0L);
}

@Override
Expand Down Expand Up @@ -639,10 +593,6 @@ public void setEstimatedSeconds(Integer estimatedSeconds) {
setValue(ESTIMATED_SECONDS, estimatedSeconds);
}

public void setSocialReminder(String socialReminder) {
setValue(SOCIAL_REMINDER, socialReminder);
}

public void setPostponeCount(Integer postponeCount) {
setValue(POSTPONE_COUNT, postponeCount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ private static void putTaskPropertyToServerName(Property<?> property, String ser
putTaskPropertyToServerName(Task.NOTES, "notes", true);
putTaskPropertyToServerName(Task.RECURRENCE, "repeat", true);
putTaskPropertyToServerName(Task.UUID, "uuid", false);
putTaskPropertyToServerName(Task.CLASSIFICATION, "classification", false);
}

// ----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public interface OnCompletedTaskListener {
Task.TIMER_START,
Task.RECURRENCE,
Task.REMINDER_LAST,
Task.SOCIAL_REMINDER,
HAS_NOTES_PROPERTY, // Whether or not the task has notes
TAGS, // Concatenated list of tags
FILE_ID_PROPERTY // File id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private int getDefaultCameraButton() {
}

private void fetchTask(long id) {
task = taskService.fetchById(id, Task.NOTES, Task.ID, Task.UUID, Task.TITLE, Task.USER_ACTIVITIES_PUSHED_AT, Task.ATTACHMENTS_PUSHED_AT);
task = taskService.fetchById(id, Task.NOTES, Task.ID, Task.UUID, Task.TITLE);
}

public void loadViewForTaskID(long t){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ private boolean showTaskNotification(long id, int type, String reminder) {

// update last reminder time
task.setReminderLast(DateUtilities.now());
task.setSocialReminder(Task.REMINDER_SOCIAL_UNSEEN);
taskDao.saveExisting(task);

String title = context.getString(R.string.app_name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onClick(View arg0) {
findViewById(R.id.reminder_complete).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Task task = taskService.fetchById(taskId, Task.ID, Task.REMINDER_LAST, Task.SOCIAL_REMINDER);
Task task = taskService.fetchById(taskId, Task.ID, Task.REMINDER_LAST);
if (task != null) {
taskService.setComplete(task, true);
}
Expand Down

0 comments on commit 5ea6054

Please sign in to comment.