Skip to content

Commit

Permalink
Fix for 13186759, note-ordering and pref-setting show all notes. coul…
Browse files Browse the repository at this point in the history
…dnt reproduce disappearing notes.
  • Loading branch information
StingerAJ authored and Tim Su committed May 16, 2011
1 parent dc7f2f5 commit 74203d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -15,6 +15,7 @@

import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.sql.Order;
import com.todoroo.andlib.sql.Query;
import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.dao.MetadataDao.MetadataCriteria;
Expand Down Expand Up @@ -56,7 +57,7 @@ protected void onCreate(Bundle savedInstanceState) {
TodorooCursor<Metadata> cursor = PluginServices.getMetadataService().query(
Query.select(Metadata.PROPERTIES).where(
MetadataCriteria.byTaskAndwithKey(task.getId(),
NoteMetadata.METADATA_KEY)));
NoteMetadata.METADATA_KEY)).orderBy(Order.desc(Metadata.CREATION_DATE)));
Metadata metadata = new Metadata();
try {
for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
Expand Down
Expand Up @@ -11,6 +11,7 @@

import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.sql.Order;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.api.AstridApiConstants;
Expand Down Expand Up @@ -51,7 +52,7 @@ public String getTaskDetails(long id) {
if(!Preferences.getBoolean(R.string.p_showNotes, false))
return null;

Task task = PluginServices.getTaskService().fetchById(id, Task.NOTES);
Task task = PluginServices.getTaskService().fetchById(id, Task.ID, Task.NOTES);
if(task == null)
return null;

Expand All @@ -64,7 +65,7 @@ public String getTaskDetails(long id) {
TodorooCursor<Metadata> cursor = PluginServices.getMetadataService().query(
Query.select(Metadata.PROPERTIES).where(
MetadataCriteria.byTaskAndwithKey(task.getId(),
NoteMetadata.METADATA_KEY)));
NoteMetadata.METADATA_KEY)).orderBy(Order.asc(Metadata.CREATION_DATE)));
Metadata metadata = new Metadata();
try {
for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
Expand Down

0 comments on commit 74203d1

Please sign in to comment.