mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix populate custom field in KDB database
This commit is contained in:
@@ -184,10 +184,21 @@ class EntryEditActivity : LockingActivity(),
|
||||
}
|
||||
registerInfo?.searchInfo?.let { searchInfo ->
|
||||
searchInfo.webDomain?.let { webDomain ->
|
||||
// If unable to save web domain in custom field or URL not populate, save in URL
|
||||
if (mDatabase?.allowEntryCustomFields() != true) {
|
||||
//|| tempEntryInfo?.url?.isEmpty() == true) {
|
||||
val scheme = "http"
|
||||
// TODO Retrieve scheme
|
||||
tempEntryInfo?.url = "$scheme://$webDomain"
|
||||
} else {
|
||||
// Save web domain in custom field
|
||||
tempEntryInfo?.addUniqueField(Field(EntryInfo.WEB_DOMAIN_FIELD_NAME,
|
||||
ProtectedString(false, webDomain))
|
||||
)
|
||||
}
|
||||
} ?: run {
|
||||
// Save application id in custom field
|
||||
if (mDatabase?.allowEntryCustomFields() == true) {
|
||||
searchInfo.applicationId?.let { applicationId ->
|
||||
tempEntryInfo?.addUniqueField(Field(EntryInfo.APPLICATION_ID_FIELD_NAME,
|
||||
ProtectedString(false, applicationId))
|
||||
@@ -195,6 +206,7 @@ class EntryEditActivity : LockingActivity(),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build fragment to manage entry modification
|
||||
entryEditFragment = supportFragmentManager.findFragmentByTag(ENTRY_EDIT_FRAGMENT_TAG) as? EntryEditFragment?
|
||||
|
||||
Reference in New Issue
Block a user