Prevent data loss when drag/drop between databases

* Fixes #5262
* Always reset the UUID on groups and entries moved or copied between databases. This prevents data loss when the group/entry is moved back to the original database.
This commit is contained in:
Jonathan White
2020-10-10 19:36:00 -04:00
parent 389899e0c6
commit b10a55a547
5 changed files with 37 additions and 28 deletions

View File

@@ -124,11 +124,6 @@ public:
CustomData* customData();
const CustomData* customData() const;
static const int DefaultIconNumber;
static const int ResolveMaximumDepth;
static const QString AutoTypeSequenceUsername;
static const QString AutoTypeSequencePassword;
void setUuid(const QUuid& uuid);
void setIcon(int iconNumber);
void setIcon(const QUuid& uuid);
@@ -209,13 +204,19 @@ public:
DbDir
};
static const int DefaultIconNumber;
static const int ResolveMaximumDepth;
static const QString AutoTypeSequenceUsername;
static const QString AutoTypeSequencePassword;
static CloneFlags DefaultCloneFlags;
/**
* Creates a duplicate of this entry except that the returned entry isn't
* part of any group.
* Note that you need to copy the custom icons manually when inserting the
* new entry into another database.
*/
Entry* clone(CloneFlags flags) const;
Entry* clone(CloneFlags flags = DefaultCloneFlags) const;
void copyDataFrom(const Entry* other);
QString maskPasswordPlaceholders(const QString& str) const;
Entry* resolveReference(const QString& str) const;