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 =
|
||||
if (entry.getAttachments(mDatabase.binaryPool).isNotEmpty())
|
||||
View.VISIBLE else View.GONE
|
||||
if (entry.containsAttachment()) View.VISIBLE else View.GONE
|
||||
|
||||
mDatabase.stopManageEntry(entry)
|
||||
}
|
||||
|
||||
@@ -336,9 +336,9 @@ class Entry : Node, EntryVersionedInterface<Group> {
|
||||
return attachments
|
||||
}
|
||||
|
||||
fun containsAttachment(attachment: Attachment, binaryPool: BinaryPool): Boolean {
|
||||
return entryKDB?.containsAttachment(attachment) == true
|
||||
|| entryKDBX?.containsAttachment(attachment, binaryPool) == true
|
||||
fun containsAttachment(): Boolean {
|
||||
return entryKDB?.containsAttachment() == true
|
||||
|| entryKDBX?.containsAttachment() == true
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -293,12 +293,8 @@ class EntryKDBX : EntryVersioned<UUID, UUID, GroupKDBX, EntryKDBX>, NodeKDBXInte
|
||||
return entryAttachmentList
|
||||
}
|
||||
|
||||
fun containsAttachment(attachment: Attachment, binaryPool: BinaryPool): Boolean {
|
||||
for ((_, poolId) in binaries) {
|
||||
if (binaryPool[poolId] == attachment.binaryAttachment)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
fun containsAttachment(): Boolean {
|
||||
return binaries.isNotEmpty()
|
||||
}
|
||||
|
||||
fun putAttachment(attachment: Attachment, binaryPool: BinaryPool) {
|
||||
|
||||
Reference in New Issue
Block a user