Added the is_folder flag to tagdata, don't show those in main tag list

pull/14/head
Sam Bosley 12 years ago
parent 886ed18319
commit 781658a514

@ -109,6 +109,10 @@ public final class TagData extends RemoteModel {
public static final IntegerProperty IS_UNREAD = new IntegerProperty(
TABLE, "isUnread");
/** Whether tag is a folder */
public static final IntegerProperty IS_FOLDER = new IntegerProperty(
TABLE, "isFolder", Property.PROP_FLAG_BOOLEAN);
/** Task count */
public static final IntegerProperty TASK_COUNT = new IntegerProperty(
TABLE, "taskCount");
@ -196,6 +200,7 @@ public final class TagData extends RemoteModel {
defaultValues.put(METADATA_PUSHED_AT.name, 0L);
defaultValues.put(USER_ACTIVITIES_PUSHED_AT.name, 0L);
defaultValues.put(TAG_ORDERING.name, "[]");
defaultValues.put(IS_FOLDER.name, 0);
}
@Override

@ -183,6 +183,7 @@ public class NameMaps {
putTagPropertyToServerName(TagData.TASK_COUNT, "task_count", false);
putTagPropertyToServerName(TagData.TAG_DESCRIPTION, "description", true);
putTagPropertyToServerName(TagData.PICTURE, "picture", true);
putTagPropertyToServerName(TagData.IS_FOLDER, "is_folder", false);
// Reverse the mapping to construct the server to local map
TAG_DATA_PROPERTIES_SERVER_TO_LOCAL = AndroidUtilities.reverseMap(TAG_DATA_PROPERTIES_LOCAL_TO_SERVER);

@ -397,15 +397,15 @@ public final class TagService {
*/
public ArrayList<Tag> getTagList() {
ArrayList<Tag> tagList = new ArrayList<Tag>();
TodorooCursor<TagData> cursor = tagDataService.query(Query.select(TagData.PROPERTIES).where(Criterion.and(TagData.DELETION_DATE.eq(0), TagData.NAME.isNotNull())).orderBy(Order.asc(Functions.upper(TagData.NAME))));
TodorooCursor<TagData> cursor = tagDataService.query(Query.select(TagData.PROPERTIES).where(Criterion.and(TagData.DELETION_DATE.eq(0), TagData.IS_FOLDER.neq(1), TagData.NAME.isNotNull())).orderBy(Order.asc(Functions.upper(TagData.NAME))));
try {
TagData tagData = new TagData();
for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
tagData.readFromCursor(cursor);
Tag tag = new Tag(tagData);
if(tagData.getFlag(TagData.FLAGS, TagData.FLAG_FEATURED)) {
continue;
}
Tag tag = new Tag(tagData);
if(TextUtils.isEmpty(tag.tag))
continue;
tagList.add(tag);

@ -53,7 +53,7 @@ public class Database extends AbstractDatabase {
* Database version number. This variable must be updated when database
* tables are updated, as it determines whether a database needs updating.
*/
public static final int VERSION = 34;
public static final int VERSION = 35;
/**
* Database name (must be unique)
@ -399,6 +399,9 @@ public class Database extends AbstractDatabase {
tryExecSQL(addColumnSql(TagData.TABLE, TagData.LAST_AUTOSYNC, visitor, null));
tryExecSQL(addColumnSql(User.TABLE, User.LAST_AUTOSYNC, visitor, null));
case 34:
tryExecSQL(addColumnSql(TagData.TABLE, TagData.IS_FOLDER, visitor, null));
return true;
}

Loading…
Cancel
Save