Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanek Bevendorff <janek@jbev.net>2021-11-11 01:11:03 +0300
committerJanek Bevendorff <janek@jbev.net>2021-11-22 14:58:04 +0300
commit835e31ac3c7c6b8f974d9821b1e398aabc24ec1b (patch)
tree8ae1f65efb638525fc3e9254c9a2cc859ef52066 /src/core/Merger.cpp
parent390e14b2c6c07532c0e04766a851ba3001020e25 (diff)
Implement KDBX 4.1 CustomData modification date
We keep the old merging behaviour for now, since deleting a CustomData entry does not create DeletedObject.
Diffstat (limited to 'src/core/Merger.cpp')
-rw-r--r--src/core/Merger.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/Merger.cpp b/src/core/Merger.cpp
index b7c832951..65c1e8fb9 100644
--- a/src/core/Merger.cpp
+++ b/src/core/Merger.cpp
@@ -617,8 +617,8 @@ Merger::ChangeList Merger::mergeMetadata(const MergeContext& context)
}
// Merge Custom Data if source is newer
- const auto targetCustomDataModificationTime = targetMetadata->customData()->getLastModified();
- const auto sourceCustomDataModificationTime = sourceMetadata->customData()->getLastModified();
+ const auto targetCustomDataModificationTime = targetMetadata->customData()->lastModified();
+ const auto sourceCustomDataModificationTime = sourceMetadata->customData()->lastModified();
if (!targetMetadata->customData()->contains(CustomData::LastModified)
|| (targetCustomDataModificationTime.isValid() && sourceCustomDataModificationTime.isValid()
&& targetCustomDataModificationTime < sourceCustomDataModificationTime)) {
@@ -628,8 +628,7 @@ Merger::ChangeList Merger::mergeMetadata(const MergeContext& context)
// Check missing keys from source. Remove those from target
for (const auto& key : targetCustomDataKeys) {
// Do not remove protected custom data
- if (!sourceMetadata->customData()->contains(key)
- && !sourceMetadata->customData()->isProtectedCustomData(key)) {
+ if (!sourceMetadata->customData()->contains(key) && !sourceMetadata->customData()->isProtected(key)) {
auto value = targetMetadata->customData()->value(key);
targetMetadata->customData()->remove(key);
changes << tr("Removed custom data %1 [%2]").arg(key, value);