mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Change containsAttachment method
This commit is contained in:
@@ -339,8 +339,7 @@ class NodeAdapter (private val context: Context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
holder.attachmentIcon?.visibility =
|
holder.attachmentIcon?.visibility =
|
||||||
if (entry.getAttachments(mDatabase.binaryPool).isNotEmpty())
|
if (entry.containsAttachment()) View.VISIBLE else View.GONE
|
||||||
View.VISIBLE else View.GONE
|
|
||||||
|
|
||||||
mDatabase.stopManageEntry(entry)
|
mDatabase.stopManageEntry(entry)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -336,9 +336,9 @@ class Entry : Node, EntryVersionedInterface<Group> {
|
|||||||
return attachments
|
return attachments
|
||||||
}
|
}
|
||||||
|
|
||||||
fun containsAttachment(attachment: Attachment, binaryPool: BinaryPool): Boolean {
|
fun containsAttachment(): Boolean {
|
||||||
return entryKDB?.containsAttachment(attachment) == true
|
return entryKDB?.containsAttachment() == true
|
||||||
|| entryKDBX?.containsAttachment(attachment, binaryPool) == true
|
|| entryKDBX?.containsAttachment() == true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun putAttachment(attachment: Attachment, binaryPool: BinaryPool) {
|
fun putAttachment(attachment: Attachment, binaryPool: BinaryPool) {
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class EntryKDB : EntryVersioned<Int, UUID, GroupKDB, EntryKDB>, NodeKDBInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun containsAttachment(attachment: Attachment): Boolean {
|
fun containsAttachment(): Boolean {
|
||||||
return binaryData != null
|
return binaryData != null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -293,12 +293,8 @@ class EntryKDBX : EntryVersioned<UUID, UUID, GroupKDBX, EntryKDBX>, NodeKDBXInte
|
|||||||
return entryAttachmentList
|
return entryAttachmentList
|
||||||
}
|
}
|
||||||
|
|
||||||
fun containsAttachment(attachment: Attachment, binaryPool: BinaryPool): Boolean {
|
fun containsAttachment(): Boolean {
|
||||||
for ((_, poolId) in binaries) {
|
return binaries.isNotEmpty()
|
||||||
if (binaryPool[poolId] == attachment.binaryAttachment)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun putAttachment(attachment: Attachment, binaryPool: BinaryPool) {
|
fun putAttachment(attachment: Attachment, binaryPool: BinaryPool) {
|
||||||
|
|||||||
Reference in New Issue
Block a user