mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Try to fix add/update database history #732
This commit is contained in:
@@ -21,6 +21,7 @@ package com.kunzisoft.keepass.app.database
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.util.Log
|
||||||
import com.kunzisoft.keepass.model.DatabaseFile
|
import com.kunzisoft.keepass.model.DatabaseFile
|
||||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||||
import com.kunzisoft.keepass.utils.SingletonHolderParameter
|
import com.kunzisoft.keepass.utils.SingletonHolderParameter
|
||||||
@@ -133,10 +134,14 @@ class FileDatabaseHistoryAction(private val applicationContext: Context) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Update values if history element not yet in the database
|
// Update values if history element not yet in the database
|
||||||
if (fileDatabaseHistoryRetrieve == null) {
|
try {
|
||||||
databaseFileHistoryDao.add(fileDatabaseHistory)
|
if (fileDatabaseHistoryRetrieve == null) {
|
||||||
} else {
|
databaseFileHistoryDao.add(fileDatabaseHistory)
|
||||||
databaseFileHistoryDao.update(fileDatabaseHistory)
|
} else {
|
||||||
|
databaseFileHistoryDao.update(fileDatabaseHistory)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Unable to add or update database history", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
val fileDatabaseInfo = FileDatabaseInfo(applicationContext,
|
val fileDatabaseInfo = FileDatabaseInfo(applicationContext,
|
||||||
@@ -208,5 +213,7 @@ class FileDatabaseHistoryAction(private val applicationContext: Context) {
|
|||||||
).execute()
|
).execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object : SingletonHolderParameter<FileDatabaseHistoryAction, Context>(::FileDatabaseHistoryAction)
|
companion object : SingletonHolderParameter<FileDatabaseHistoryAction, Context>(::FileDatabaseHistoryAction) {
|
||||||
|
private val TAG = FileDatabaseHistoryAction::class.java.name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user