Merge branch 'feature/Dynamic_Memory' into feature/Dynamic_Memory_And_Encrypt_Module

This commit is contained in:
J-Jamet
2021-03-23 21:24:54 +01:00
5 changed files with 5 additions and 14 deletions

View File

@@ -96,10 +96,6 @@ class BinaryByte : BinaryData {
}
}
override fun dataExists(binaryCache: BinaryCache): Boolean {
return getByteArray(binaryCache).isNotEmpty()
}
@Throws(IOException::class)
override fun clear(binaryCache: BinaryCache) {
binaryCache.removeByteArray(mDataByteId)

View File

@@ -96,7 +96,7 @@ abstract class BinaryData : Parcelable {
abstract fun decompress(binaryCache: BinaryCache)
@Throws(IOException::class)
open fun dataExists(binaryCache: BinaryCache): Boolean {
fun dataExists(): Boolean {
return mLength > 0
}

View File

@@ -142,10 +142,6 @@ class BinaryFile : BinaryData {
}
}
override fun dataExists(binaryCache: BinaryCache): Boolean {
return mDataFile != null && super.dataExists(binaryCache)
}
override fun clear(binaryCache: BinaryCache) {
if (mDataFile != null && !mDataFile!!.delete())
throw IOException("Unable to delete temp file " + mDataFile!!.absolutePath)

View File

@@ -695,7 +695,7 @@ class DatabaseOutputKDBX(private val mDatabaseKDBX: DatabaseKDBX,
var firstElement = true
val binaryCache = mDatabaseKDBX.binaryCache
mDatabaseKDBX.iconsManager.doForEachCustomIcon { iconCustom, binary ->
if (binary.dataExists(binaryCache)) {
if (binary.dataExists()) {
// Write the parent tag
if (firstElement) {
xml.startTag(null, DatabaseKDBXXML.ElemCustomIcons)

View File

@@ -70,7 +70,7 @@ class IconDrawableFactory(private val retrieveBinaryCache : () -> BinaryCache?,
val icon = iconDraw.getIconImageToDraw()
val customIconBinary = retrieveCustomIconBinary(icon.custom.uuid)
val binaryCache = retrieveBinaryCache()
if (binaryCache != null && customIconBinary != null && customIconBinary.dataExists(binaryCache)) {
if (binaryCache != null && customIconBinary != null && customIconBinary.dataExists()) {
getIconDrawable(context.resources, icon.custom, customIconBinary)?.let {
return SuperDrawable(it)
}
@@ -216,9 +216,8 @@ class IconDrawableFactory(private val retrieveBinaryCache : () -> BinaryCache?,
private fun addToCustomCache(resources: Resources, iconDraw: IconImageDraw) {
val icon = iconDraw.getIconImageToDraw()
val customIconBinary = retrieveCustomIconBinary(icon.custom.uuid)
val binaryCache = retrieveBinaryCache()
if (customIconBinary != null && binaryCache != null
&& customIconBinary.dataExists(binaryCache)
if (customIconBinary != null
&& customIconBinary.dataExists()
&& !customIconMap.containsKey(icon.custom.uuid))
getIconDrawable(resources, icon.custom, customIconBinary)
}