Use identity IP by default

This commit is contained in:
M66B 2019-02-28 16:05:55 +00:00
parent c8238ae1ae
commit 26290a693a
4 changed files with 1544 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -72,7 +72,7 @@ public class EntityIdentity {
public String password;
public String realm;
@NonNull
public Boolean use_ip = false; // instead of domain name
public Boolean use_ip = true; // instead of domain name
@NonNull
public Boolean synchronize;
@NonNull

View File

@ -757,7 +757,7 @@ public class FragmentIdentity extends FragmentBase {
etUser.setText(identity == null ? null : identity.user);
tilPassword.getEditText().setText(identity == null ? null : identity.password);
etRealm.setText(identity == null ? null : identity.realm);
cbUseIp.setChecked(identity == null ? false : identity.use_ip);
cbUseIp.setChecked(identity == null ? true : identity.use_ip);
cbSynchronize.setChecked(identity == null ? true : identity.synchronize);
cbPrimary.setChecked(identity == null ? true : identity.primary);