mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Merge branch 'feature/Dynamic_Memory' into feature/Dynamic_Memory_And_Encrypt_Module
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user