mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix template entry edition
This commit is contained in:
@@ -165,6 +165,18 @@ class Database {
|
|||||||
return templatesGroup == entry.parent
|
return templatesGroup == entry.parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Not the same as decode, here remove in all cases the template link in the entry data
|
||||||
|
fun removeTemplateConfiguration(entry: Entry): Entry {
|
||||||
|
entry.entryKDBX?.let {
|
||||||
|
mDatabaseKDBX?.decodeEntryWithTemplateConfiguration(it, false)?.let { decode ->
|
||||||
|
return Entry(decode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return entry
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the template link in the entry data if it's a basic entry
|
||||||
|
// or compress the template fields (as pseudo language) if it's a template entry
|
||||||
fun decodeEntryWithTemplateConfiguration(entry: Entry, lastEntryVersion: Entry? = null): Entry {
|
fun decodeEntryWithTemplateConfiguration(entry: Entry, lastEntryVersion: Entry? = null): Entry {
|
||||||
entry.entryKDBX?.let {
|
entry.entryKDBX?.let {
|
||||||
val lastEntry = lastEntryVersion ?: entry
|
val lastEntry = lastEntryVersion ?: entry
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ class Entry : Node, EntryVersionedInterface<Group> {
|
|||||||
fun getEntryInfo(database: Database?, raw: Boolean = false): EntryInfo {
|
fun getEntryInfo(database: Database?, raw: Boolean = false): EntryInfo {
|
||||||
val entryInfo = EntryInfo()
|
val entryInfo = EntryInfo()
|
||||||
// Remove unwanted template fields
|
// Remove unwanted template fields
|
||||||
(database?.decodeEntryWithTemplateConfiguration(this) ?: this).apply {
|
(database?.removeTemplateConfiguration(this) ?: this).apply {
|
||||||
if (raw)
|
if (raw)
|
||||||
database?.stopManageEntry(this)
|
database?.stopManageEntry(this)
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user