mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-27 00:35:27 -04:00
Fix duplicate icon add in export
SharedObserver did not check for already added icons add during export leading to duplicate icons in the target db.
This commit is contained in:
parent
771ecdba12
commit
05bee40f0a
5 changed files with 37 additions and 5 deletions
|
@ -592,7 +592,8 @@ Database* ShareObserver::exportIntoContainer(const KeeShareSettings::Reference&
|
|||
{
|
||||
const auto* sourceDb = sourceRoot->database();
|
||||
auto* targetDb = new Database();
|
||||
targetDb->metadata()->setRecycleBinEnabled(false);
|
||||
auto* targetMetadata = targetDb->metadata();
|
||||
targetMetadata->setRecycleBinEnabled(false);
|
||||
auto key = QSharedPointer<CompositeKey>::create();
|
||||
key->addKey(QSharedPointer<PasswordKey>::create(reference.password));
|
||||
|
||||
|
@ -610,8 +611,8 @@ Database* ShareObserver::exportIntoContainer(const KeeShareSettings::Reference&
|
|||
targetEntry->setGroup(targetRoot);
|
||||
targetEntry->setUpdateTimeinfo(updateTimeinfo);
|
||||
const auto iconUuid = targetEntry->iconUuid();
|
||||
if (!iconUuid.isNull()) {
|
||||
targetDb->metadata()->addCustomIcon(iconUuid, sourceEntry->icon());
|
||||
if (!iconUuid.isNull() && !targetMetadata->containsCustomIcon(iconUuid)) {
|
||||
targetMetadata->addCustomIcon(iconUuid, sourceEntry->icon());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue