Use identity IP by default

pull/152/head
M66B 7 years ago
parent c8238ae1ae
commit 26290a693a

File diff suppressed because it is too large Load Diff

@ -49,7 +49,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html // https://developer.android.com/topic/libraries/architecture/room.html
@Database( @Database(
version = 47, version = 48,
entities = { entities = {
EntityIdentity.class, EntityIdentity.class,
EntityAccount.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"); 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(); .build();
} }

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

@ -757,7 +757,7 @@ public class FragmentIdentity extends FragmentBase {
etUser.setText(identity == null ? null : identity.user); etUser.setText(identity == null ? null : identity.user);
tilPassword.getEditText().setText(identity == null ? null : identity.password); tilPassword.getEditText().setText(identity == null ? null : identity.password);
etRealm.setText(identity == null ? null : identity.realm); 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); cbSynchronize.setChecked(identity == null ? true : identity.synchronize);
cbPrimary.setChecked(identity == null ? true : identity.primary); cbPrimary.setChecked(identity == null ? true : identity.primary);

Loading…
Cancel
Save