Store folder separator

This commit is contained in:
M66B 2019-06-26 08:13:39 +02:00
parent 1774a619e0
commit 6f67982ce0
5 changed files with 1807 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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();

View File

@ -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();
}

View File

@ -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);

View File

@ -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