Skip to content

Commit

Permalink
plusonelabs#356 Fix Task Providers' queries as noticed at plusonelabs…
Browse files Browse the repository at this point in the history
  • Loading branch information
yvolk committed Jan 19, 2020
1 parent 8253250 commit a9b6004
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

defaultConfig {
versionCode getCommitCount()
versionName '4.0.0' + "-" + versionCode
versionName '4.0.1' + "-" + versionCode
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,10 @@ private String getWhereClause() {
whereBuilder.append(DmfsOpenTasksContract.Tasks.COLUMN_STATUS).append(NOT_EQUALS)
.append(DmfsOpenTasksContract.Tasks.STATUS_COMPLETED);

whereBuilder.append(AND_BRACKET)
.append(DmfsOpenTasksContract.Tasks.COLUMN_DUE_DATE).append(LTE).append(mEndOfTimeRange.getMillis())
.append(OR)
.append(OPEN_BRACKET)
.append(DmfsOpenTasksContract.Tasks.COLUMN_DUE_DATE).append(IS_NULL)
.append(AND_BRACKET)
.append(DmfsOpenTasksContract.Tasks.COLUMN_START_DATE).append(LTE).append(mEndOfTimeRange.getMillis())
.append(OR)
.append(DmfsOpenTasksContract.Tasks.COLUMN_START_DATE).append(IS_NULL)
.append(CLOSING_BRACKET)
.append(CLOSING_BRACKET)
.append(CLOSING_BRACKET);
whereBuilder.append(AND_BRACKET +
DmfsOpenTasksContract.Tasks.COLUMN_START_DATE + LTE + mEndOfTimeRange.getMillis() +
OR + DmfsOpenTasksContract.Tasks.COLUMN_START_DATE + IS_NULL +
CLOSING_BRACKET);
}

Set<String> taskLists = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.andstatus.todoagenda.R;
import org.andstatus.todoagenda.prefs.EventSource;
import org.andstatus.todoagenda.prefs.FilterMode;
import org.andstatus.todoagenda.prefs.OrderedEventSource;
import org.andstatus.todoagenda.provider.EventProviderType;
import org.andstatus.todoagenda.task.AbstractTaskProvider;
Expand Down Expand Up @@ -56,14 +57,11 @@ public List<TaskEvent> queryTasks() {

private String getWhereClause() {
StringBuilder whereBuilder = new StringBuilder();
whereBuilder.append(SamsungTasksContract.Tasks.COLUMN_COMPLETE).append(EQUALS).append("0");
whereBuilder.append(AND).append(SamsungTasksContract.Tasks.COLUMN_DELETED).append(EQUALS).append("0");

whereBuilder.append(AND_BRACKET)
.append(SamsungTasksContract.Tasks.COLUMN_DUE_DATE).append(LTE).append(mEndOfTimeRange.getMillis())
.append(OR)
.append(SamsungTasksContract.Tasks.COLUMN_DUE_DATE).append(IS_NULL)
.append(CLOSING_BRACKET);
whereBuilder.append(SamsungTasksContract.Tasks.COLUMN_DELETED).append(EQUALS).append("0");

if (getFilterMode() == FilterMode.NORMAL_FILTER) {
whereBuilder.append(AND).append(SamsungTasksContract.Tasks.COLUMN_COMPLETE).append(EQUALS).append("0");
}

Set<String> taskLists = new HashSet<>();
for (OrderedEventSource orderedSource: getSettings().getActiveEventSources(type)) {
Expand Down

0 comments on commit a9b6004

Please sign in to comment.