mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-01 11:06:17 -04:00
Only updating custom group icon if set.
This commit is contained in:
parent
9603c91877
commit
2ff56fe86c
1 changed files with 8 additions and 5 deletions
|
@ -681,12 +681,12 @@ void Group::merge(const Group* other)
|
||||||
|
|
||||||
Entry* existingEntry = rootGroup->findEntryByUuid(entry->uuid());
|
Entry* existingEntry = rootGroup->findEntryByUuid(entry->uuid());
|
||||||
|
|
||||||
// This entry does not exist at all. Create it.
|
|
||||||
if (!existingEntry) {
|
if (!existingEntry) {
|
||||||
|
// This entry does not exist at all. Create it.
|
||||||
qDebug("New entry %s detected. Creating it.", qPrintable(entry->title()));
|
qDebug("New entry %s detected. Creating it.", qPrintable(entry->title()));
|
||||||
entry->clone(Entry::CloneIncludeHistory)->setGroup(this);
|
entry->clone(Entry::CloneIncludeHistory)->setGroup(this);
|
||||||
// Entry is already present in the database. Update it.
|
|
||||||
} else {
|
} else {
|
||||||
|
// Entry is already present in the database. Update it.
|
||||||
bool locationChanged = existingEntry->timeInfo().locationChanged() < entry->timeInfo().locationChanged();
|
bool locationChanged = existingEntry->timeInfo().locationChanged() < entry->timeInfo().locationChanged();
|
||||||
if (locationChanged && existingEntry->group() != this) {
|
if (locationChanged && existingEntry->group() != this) {
|
||||||
existingEntry->setGroup(this);
|
existingEntry->setGroup(this);
|
||||||
|
@ -978,13 +978,16 @@ void Group::resolveGroupConflict(Group* existingGroup, Group* otherGroup)
|
||||||
const QDateTime timeExisting = existingGroup->timeInfo().lastModificationTime();
|
const QDateTime timeExisting = existingGroup->timeInfo().lastModificationTime();
|
||||||
const QDateTime timeOther = otherGroup->timeInfo().lastModificationTime();
|
const QDateTime timeOther = otherGroup->timeInfo().lastModificationTime();
|
||||||
|
|
||||||
// only if the other group newer, update the existing one.
|
// only if the other group is newer, update the existing one.
|
||||||
if (timeExisting < timeOther) {
|
if (timeExisting < timeOther) {
|
||||||
qDebug("Updating group %s.", qPrintable(existingGroup->name()));
|
qDebug("Updating group %s.", qPrintable(existingGroup->name()));
|
||||||
existingGroup->setName(otherGroup->name());
|
existingGroup->setName(otherGroup->name());
|
||||||
existingGroup->setNotes(otherGroup->notes());
|
existingGroup->setNotes(otherGroup->notes());
|
||||||
existingGroup->setIcon(otherGroup->iconNumber());
|
if (otherGroup->iconNumber() == 0) {
|
||||||
existingGroup->setIcon(otherGroup->iconUuid());
|
existingGroup->setIcon(otherGroup->iconUuid());
|
||||||
|
} else {
|
||||||
|
existingGroup->setIcon(otherGroup->iconNumber());
|
||||||
|
}
|
||||||
existingGroup->setExpiryTime(otherGroup->timeInfo().expiryTime());
|
existingGroup->setExpiryTime(otherGroup->timeInfo().expiryTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue