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:
Diffstat (limited to 'src/core/Merger.cpp')
-rw-r--r--src/core/Merger.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/Merger.cpp b/src/core/Merger.cpp
index 4cce997bf..83b1e5a44 100644
--- a/src/core/Merger.cpp
+++ b/src/core/Merger.cpp
@@ -612,12 +612,11 @@ Merger::ChangeList Merger::mergeMetadata(const MergeContext& context)
auto* sourceMetadata = context.m_sourceDb->metadata();
auto* targetMetadata = context.m_targetDb->metadata();
- const auto keys = sourceMetadata->customIcons().keys();
- for (QUuid customIconId : keys) {
- if (!targetMetadata->containsCustomIcon(customIconId)) {
- QImage customIcon = sourceMetadata->customIcon(customIconId);
- targetMetadata->addCustomIcon(customIconId, customIcon);
- changes << tr("Adding missing icon %1").arg(QString::fromLatin1(customIconId.toRfc4122().toHex()));
+ for (const auto& iconUuid : sourceMetadata->customIconsOrder()) {
+ if (!targetMetadata->hasCustomIcon(iconUuid)) {
+ QImage customIcon = sourceMetadata->customIcon(iconUuid);
+ targetMetadata->addCustomIcon(iconUuid, customIcon);
+ changes << tr("Adding missing icon %1").arg(QString::fromLatin1(iconUuid.toRfc4122().toHex()));
}
}
@@ -632,7 +631,9 @@ Merger::ChangeList Merger::mergeMetadata(const MergeContext& context)
// Check missing keys from source. Remove those from target
for (const auto& key : targetCustomDataKeys) {
- if (!sourceMetadata->customData()->contains(key)) {
+ // Do not remove protected custom data
+ if (!sourceMetadata->customData()->contains(key)
+ && !sourceMetadata->customData()->isProtectedCustomData(key)) {
auto value = targetMetadata->customData()->value(key);
targetMetadata->customData()->remove(key);
changes << tr("Removed custom data %1 [%2]").arg(key, value);