Rename removeUnlinkedAttachments

This commit is contained in:
J-Jamet
2020-08-26 19:25:30 +02:00
parent dc3d720e8d
commit 9489f1ee3d
3 changed files with 5 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ open class SaveDatabaseRunnable(protected var context: Context,
override fun onStartRun() {} override fun onStartRun() {}
override fun onActionRun() { override fun onActionRun() {
database.removeUnlinkedAttachment() // TODO as setting database.removeUnlinkedAttachments()
if (saveDatabase && result.isSuccess) { if (saveDatabase && result.isSuccess) {
try { try {
database.saveData(context.contentResolver) database.saveData(context.contentResolver)

View File

@@ -454,9 +454,9 @@ class Database {
mDatabaseKDBX?.removeAttachmentIfNotUsed(attachment) mDatabaseKDBX?.removeAttachmentIfNotUsed(attachment)
} }
fun removeUnlinkedAttachment() { fun removeUnlinkedAttachments() {
// No check in database KDB because unique attachment by entry // No check in database KDB because unique attachment by entry
mDatabaseKDBX?.removeUnlinkedAttachment() mDatabaseKDBX?.removeUnlinkedAttachments()
} }
@Throws(DatabaseOutputException::class) @Throws(DatabaseOutputException::class)

View File

@@ -553,10 +553,10 @@ class DatabaseKDBX : DatabaseVersioned<UUID, UUID, GroupKDBX, EntryKDBX> {
fun removeAttachmentIfNotUsed(attachment: Attachment) { fun removeAttachmentIfNotUsed(attachment: Attachment) {
// Remove attachment from pool // Remove attachment from pool
removeUnlinkedAttachment(attachment.binaryAttachment) removeUnlinkedAttachments(attachment.binaryAttachment)
} }
fun removeUnlinkedAttachment(vararg binaries: BinaryAttachment) { fun removeUnlinkedAttachments(vararg binaries: BinaryAttachment) {
// Build binaries to remove with all binaries known // Build binaries to remove with all binaries known
val binariesToRemove = ArrayList<BinaryAttachment>() val binariesToRemove = ArrayList<BinaryAttachment>()
if (binaries.isEmpty()) { if (binaries.isEmpty()) {