mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-30 13:52:58 -08:00
Merge branch 'develop' into feature/Merge_Data
This commit is contained in:
commit
2a4fbbfb35
29 files changed
+431
-124
No files matched your search
+5
-1
@@ -36,7 +36,11 @@ abstract class ActionNodeDatabaseRunnable(
|
||||
abstract fun nodeAction()
|
||||
|
||||
override fun onStartRun() {
|
||||
nodeAction()
|
||||
try {
|
||||
nodeAction()
|
||||
} catch (e: Exception) {
|
||||
setError(e)
|
||||
}
|
||||
super.onStartRun()
|
||||
}
|
||||
|
||||
|
||||
@@ -284,27 +284,33 @@ class DatabaseInputKDB(database: DatabaseKDB)
|
||||
newGroup = null
|
||||
}
|
||||
newEntry?.let { entry ->
|
||||
mDatabase.addEntryIndex(entry)
|
||||
// Parse meta info
|
||||
if (entry.isMetaStreamDefaultUsername()) {
|
||||
var defaultUser = ""
|
||||
entry.getBinary(mDatabase.attachmentPool)
|
||||
?.getInputDataStream(mDatabase.binaryCache)?.use {
|
||||
defaultUser = String(it.readBytes())
|
||||
}
|
||||
mDatabase.defaultUserName = defaultUser
|
||||
} else if (entry.isMetaStreamDatabaseColor()) {
|
||||
var color: Int? = null
|
||||
entry.getBinary(mDatabase.attachmentPool)
|
||||
?.getInputDataStream(mDatabase.binaryCache)?.use {
|
||||
val reverseColor = UnsignedInt(it.readBytes4ToUInt()).toKotlinInt()
|
||||
color = Color.rgb(
|
||||
Color.blue(reverseColor),
|
||||
Color.green(reverseColor),
|
||||
Color.red(reverseColor)
|
||||
)
|
||||
}
|
||||
mDatabase.color = color
|
||||
when {
|
||||
entry.isMetaStreamDefaultUsername() -> {
|
||||
var defaultUser = ""
|
||||
entry.getBinary(mDatabase.attachmentPool)
|
||||
?.getInputDataStream(mDatabase.binaryCache)?.use {
|
||||
defaultUser = String(it.readBytes())
|
||||
}
|
||||
mDatabase.defaultUserName = defaultUser
|
||||
}
|
||||
entry.isMetaStreamDatabaseColor() -> {
|
||||
var color: Int? = null
|
||||
entry.getBinary(mDatabase.attachmentPool)
|
||||
?.getInputDataStream(mDatabase.binaryCache)?.use {
|
||||
val reverseColor = UnsignedInt(it.readBytes4ToUInt()).toKotlinInt()
|
||||
color = Color.rgb(
|
||||
Color.blue(reverseColor),
|
||||
Color.green(reverseColor),
|
||||
Color.red(reverseColor)
|
||||
)
|
||||
}
|
||||
mDatabase.color = color
|
||||
}
|
||||
// TODO manager other meta stream
|
||||
else -> {
|
||||
mDatabase.addEntryIndex(entry)
|
||||
}
|
||||
}
|
||||
currentEntryNumber++
|
||||
newEntry = null
|
||||
|
||||
@@ -404,37 +404,61 @@ abstract class TemplateAbstractView<
|
||||
|
||||
// Icon already populate
|
||||
|
||||
val titleView: TEntryFieldView? = findViewWithTag(FIELD_TITLE_TAG)
|
||||
titleView?.value?.let {
|
||||
mEntryInfo?.title = it
|
||||
try {
|
||||
val titleView: TEntryFieldView? = findViewWithTag(FIELD_TITLE_TAG)
|
||||
titleView?.value?.let {
|
||||
mEntryInfo?.title = it
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to populate title view", e)
|
||||
}
|
||||
|
||||
val userNameView: TEntryFieldView? = findViewWithTag(FIELD_USERNAME_TAG)
|
||||
userNameView?.value?.let {
|
||||
mEntryInfo?.username = it
|
||||
try {
|
||||
val userNameView: TEntryFieldView? = findViewWithTag(FIELD_USERNAME_TAG)
|
||||
userNameView?.value?.let {
|
||||
mEntryInfo?.username = it
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to populate username view", e)
|
||||
}
|
||||
|
||||
val passwordView: TEntryFieldView? = findViewWithTag(FIELD_PASSWORD_TAG)
|
||||
passwordView?.value?.let {
|
||||
mEntryInfo?.password = it
|
||||
try {
|
||||
val passwordView: TEntryFieldView? = findViewWithTag(FIELD_PASSWORD_TAG)
|
||||
passwordView?.value?.let {
|
||||
mEntryInfo?.password = it
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to populate password view", e)
|
||||
}
|
||||
|
||||
val urlView: TEntryFieldView? = findViewWithTag(FIELD_URL_TAG)
|
||||
urlView?.value?.let {
|
||||
mEntryInfo?.url = it
|
||||
try {
|
||||
val urlView: TEntryFieldView? = findViewWithTag(FIELD_URL_TAG)
|
||||
urlView?.value?.let {
|
||||
mEntryInfo?.url = it
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to populate url view", e)
|
||||
}
|
||||
|
||||
val expirationView: TDateTimeView? = findViewWithTag(FIELD_EXPIRES_TAG)
|
||||
expirationView?.activation?.let {
|
||||
mEntryInfo?.expires = it
|
||||
}
|
||||
expirationView?.dateTime?.let {
|
||||
mEntryInfo?.expiryTime = it
|
||||
try {
|
||||
val expirationView: TDateTimeView? = findViewWithTag(FIELD_EXPIRES_TAG)
|
||||
expirationView?.activation?.let {
|
||||
mEntryInfo?.expires = it
|
||||
}
|
||||
expirationView?.dateTime?.let {
|
||||
mEntryInfo?.expiryTime = it
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to populate expiration view", e)
|
||||
}
|
||||
|
||||
val notesView: TEntryFieldView? = findViewWithTag(FIELD_NOTES_TAG)
|
||||
notesView?.value?.let {
|
||||
mEntryInfo?.notes = it
|
||||
try {
|
||||
val notesView: TEntryFieldView? = findViewWithTag(FIELD_NOTES_TAG)
|
||||
notesView?.value?.let {
|
||||
mEntryInfo?.notes = it
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to populate notes view", e)
|
||||
}
|
||||
|
||||
retrieveCustomFieldsFromView(templateFieldNotEmpty, retrieveDefaultValues)
|
||||
|
||||
Reference in new issue
Block a user