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 ->
|
registerInfo?.searchInfo?.let { searchInfo ->
|
||||||
searchInfo.webDomain?.let { webDomain ->
|
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,
|
tempEntryInfo?.addUniqueField(Field(EntryInfo.WEB_DOMAIN_FIELD_NAME,
|
||||||
ProtectedString(false, webDomain))
|
ProtectedString(false, webDomain))
|
||||||
)
|
)
|
||||||
|
}
|
||||||
} ?: run {
|
} ?: run {
|
||||||
|
// Save application id in custom field
|
||||||
|
if (mDatabase?.allowEntryCustomFields() == true) {
|
||||||
searchInfo.applicationId?.let { applicationId ->
|
searchInfo.applicationId?.let { applicationId ->
|
||||||
tempEntryInfo?.addUniqueField(Field(EntryInfo.APPLICATION_ID_FIELD_NAME,
|
tempEntryInfo?.addUniqueField(Field(EntryInfo.APPLICATION_ID_FIELD_NAME,
|
||||||
ProtectedString(false, applicationId))
|
ProtectedString(false, applicationId))
|
||||||
@@ -195,6 +206,7 @@ class EntryEditActivity : LockingActivity(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Build fragment to manage entry modification
|
// Build fragment to manage entry modification
|
||||||
entryEditFragment = supportFragmentManager.findFragmentByTag(ENTRY_EDIT_FRAGMENT_TAG) as? EntryEditFragment?
|
entryEditFragment = supportFragmentManager.findFragmentByTag(ENTRY_EDIT_FRAGMENT_TAG) as? EntryEditFragment?
|
||||||
@@ -708,7 +720,7 @@ class EntryEditActivity : LockingActivity(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onApprovedBackPressed(approved: ()-> Unit) {
|
private fun onApprovedBackPressed(approved: () -> Unit) {
|
||||||
AlertDialog.Builder(this)
|
AlertDialog.Builder(this)
|
||||||
.setMessage(R.string.discard_changes)
|
.setMessage(R.string.discard_changes)
|
||||||
.setNegativeButton(android.R.string.cancel, null)
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
|
|||||||
Reference in New Issue
Block a user