Files
KeePassDX/database/src/main/java/com/kunzisoft/keepass/model/DatabaseFile.kt
T
Richard Macklin a28d77ba32 feat: Remember the last read-only state of each database
The app has supported a global setting for opening (all) databases in
read-only mode. But that's not particularly flexible for the use case
where you have one database that should be read-only and one that should
be read-write.

Previously, to handle this use case you could open one database in
read-only mode, but the next time you attempted to open the same
database, it would "forget" that, so you would have to toggle it to
read-only mode again manually. This commit changes that behavior so that
if you toggle a database to read-only mode, it'll be remembered the next
time you open the database. (You can still toggle it back to read-write
if you change your mind, and that, too, will be remembered the next time
you open the database.)
2025-08-26 20:08:22 -07:00

29 lines
1.0 KiB
Kotlin

package com.kunzisoft.keepass.model
import android.net.Uri
import com.kunzisoft.keepass.hardware.HardwareKey
data class DatabaseFile(var databaseUri: Uri? = null,
var keyFileUri: Uri? = null,
var hardwareKey: HardwareKey? = null,
var readOnly: Boolean? = null,
var databaseDecodedPath: String? = null,
var databaseAlias: String? = null,
var databaseFileExists: Boolean = false,
var databaseLastModified: String? = null,
var databaseSize: String? = null) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is DatabaseFile) return false
if (databaseUri == null || other.databaseUri == null) return false
if (databaseUri != other.databaseUri) return false
return true
}
override fun hashCode(): Int {
return databaseUri?.hashCode() ?: 0
}
}