mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-05 16:22:31 -08:00
fix: Save search info if URL present #2255
This commit is contained in:
6 files changed
+34
-5
No files matched your search
@@ -841,7 +841,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
// Open child group
|
||||
loadMainGroup(GroupState(group.nodeId, 0))
|
||||
} catch (e: ClassCastException) {
|
||||
Log.e(TAG, "Node can't be cast in Group")
|
||||
Log.e(TAG, "Node can't be cast in Group", e)
|
||||
}
|
||||
|
||||
Type.ENTRY -> try {
|
||||
@@ -867,6 +867,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
if (!database.isReadOnly
|
||||
&& searchInfo != null
|
||||
&& PreferencesUtil.isKeyboardSaveSearchInfoEnable(this@GroupActivity)
|
||||
&& entryVersioned.containsSearchInfo(database, searchInfo).not()
|
||||
) {
|
||||
updateEntryWithRegisterInfo(
|
||||
database,
|
||||
@@ -884,6 +885,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
if (!database.isReadOnly
|
||||
&& searchInfo != null
|
||||
&& PreferencesUtil.isAutofillSaveSearchInfoEnable(this@GroupActivity)
|
||||
&& entryVersioned.containsSearchInfo(database, searchInfo).not()
|
||||
) {
|
||||
updateEntryWithRegisterInfo(
|
||||
database,
|
||||
@@ -912,7 +914,7 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
finish()
|
||||
})
|
||||
} catch (e: ClassCastException) {
|
||||
Log.e(TAG, "Node can't be cast in Entry")
|
||||
Log.e(TAG, "Node can't be cast in Entry", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -981,6 +983,17 @@ class GroupActivity : DatabaseLockActivity(),
|
||||
updateEntry(entry, newEntry)
|
||||
}
|
||||
|
||||
private fun Entry.containsSearchInfo(
|
||||
database: ContextualDatabase,
|
||||
searchInfo: SearchInfo
|
||||
): Boolean {
|
||||
return getEntryInfo(
|
||||
database,
|
||||
raw = true,
|
||||
removeTemplateConfiguration = false
|
||||
).containsSearchInfo(searchInfo)
|
||||
}
|
||||
|
||||
private fun finishNodeAction() {
|
||||
actionNodeMode?.finish()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user