Store folder separator

pull/157/head
M66B 5 years ago
parent 1774a619e0
commit 6f67982ce0

File diff suppressed because it is too large Load Diff

@ -830,6 +830,7 @@ class Core {
Folder defaultFolder = istore.getDefaultFolder();
char separator = defaultFolder.getSeparator();
EntityLog.log(context, account.name + " folder separator=" + separator);
db.account().setFolderSeparator(account.id, separator);
// Get remote folders
long start = new Date().getTime();

@ -54,7 +54,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 88,
version = 89,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -876,6 +876,13 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `account` ADD COLUMN `partial_fetch` INTEGER NOT NULL DEFAULT 1");
}
})
.addMigrations(new Migration(88, 89) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `account` ADD COLUMN `separator` INTEGER");
}
})
.build();
}

@ -102,6 +102,9 @@ public interface DaoAccount {
@Update
void updateAccount(EntityAccount account);
@Query("UPDATE account SET separator = :separator WHERE id = :id")
int setFolderSeparator(long id, Character separator);
@Query("UPDATE account SET synchronize = :synchronize WHERE id = :id")
int setAccountSynchronize(long id, boolean synchronize);

@ -85,6 +85,7 @@ public class EntityAccount extends EntityOrder implements Serializable {
public Boolean notify;
@NonNull
public Boolean browse = true;
public Character separator;
public Long swipe_left;
public Long swipe_right;
@NonNull

Loading…
Cancel
Save