mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-31 02:28:54 -04:00
parent
4b5248ee98
commit
a74e2391e8
6 changed files with 36 additions and 19 deletions
|
@ -36,8 +36,6 @@ const int Entry::ResolveMaximumDepth = 10;
|
|||
const QString Entry::AutoTypeSequenceUsername = "{USERNAME}{ENTER}";
|
||||
const QString Entry::AutoTypeSequencePassword = "{PASSWORD}{ENTER}";
|
||||
|
||||
Entry::CloneFlags Entry::DefaultCloneFlags = Entry::CloneNewUuid | Entry::CloneResetTimeInfo;
|
||||
|
||||
Entry::Entry()
|
||||
: m_attributes(new EntryAttributes(this))
|
||||
, m_attachments(new EntryAttachments(this))
|
||||
|
|
|
@ -160,6 +160,8 @@ public:
|
|||
CloneNewUuid = 1, // generate a random uuid for the clone
|
||||
CloneResetTimeInfo = 2, // set all TimeInfo attributes to the current time
|
||||
CloneIncludeHistory = 4, // clone the history items
|
||||
CloneDefault = CloneNewUuid | CloneResetTimeInfo,
|
||||
CloneCopy = CloneNewUuid | CloneResetTimeInfo | CloneIncludeHistory,
|
||||
CloneRenameTitle = 8, // add "-Clone" after the original title
|
||||
CloneUserAsRef = 16, // Add the user as a reference to the original entry
|
||||
ClonePassAsRef = 32, // Add the password as a reference to the original entry
|
||||
|
@ -209,7 +211,6 @@ public:
|
|||
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
|
||||
|
@ -217,7 +218,7 @@ public:
|
|||
* Note that you need to copy the custom icons manually when inserting the
|
||||
* new entry into another database.
|
||||
*/
|
||||
Entry* clone(CloneFlags flags = DefaultCloneFlags) const;
|
||||
Entry* clone(CloneFlags flags = CloneDefault) const;
|
||||
void copyDataFrom(const Entry* other);
|
||||
QString maskPasswordPlaceholders(const QString& str) const;
|
||||
Entry* resolveReference(const QString& str) const;
|
||||
|
|
|
@ -36,9 +36,6 @@ const int Group::DefaultIconNumber = 48;
|
|||
const int Group::RecycleBinIconNumber = 43;
|
||||
const QString Group::RootAutoTypeSequence = "{USERNAME}{TAB}{PASSWORD}{ENTER}";
|
||||
|
||||
Group::CloneFlags Group::DefaultCloneFlags =
|
||||
Group::CloneNewUuid | Group::CloneResetTimeInfo | Group::CloneIncludeEntries;
|
||||
|
||||
Group::Group()
|
||||
: m_customData(new CustomData(this))
|
||||
, m_updateTimeinfo(true)
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
CloneNewUuid = 1, // generate a random uuid for the clone
|
||||
CloneResetTimeInfo = 2, // set all TimeInfo attributes to the current time
|
||||
CloneIncludeEntries = 4, // clone the group entries
|
||||
CloneDefault = CloneNewUuid | CloneResetTimeInfo | CloneIncludeEntries,
|
||||
};
|
||||
Q_DECLARE_FLAGS(CloneFlags, CloneFlag)
|
||||
|
||||
|
@ -108,7 +109,6 @@ public:
|
|||
|
||||
static const int DefaultIconNumber;
|
||||
static const int RecycleBinIconNumber;
|
||||
static CloneFlags DefaultCloneFlags;
|
||||
static const QString RootAutoTypeSequence;
|
||||
|
||||
Group* findChildByName(const QString& name);
|
||||
|
@ -157,8 +157,8 @@ public:
|
|||
QSet<QUuid> customIconsRecursive() const;
|
||||
QList<QString> usernamesRecursive(int topN = -1) const;
|
||||
|
||||
Group* clone(Entry::CloneFlags entryFlags = Entry::DefaultCloneFlags,
|
||||
CloneFlags groupFlags = DefaultCloneFlags) const;
|
||||
Group* clone(Entry::CloneFlags entryFlags = Entry::CloneDefault,
|
||||
Group::CloneFlags groupFlags = Group::CloneDefault) const;
|
||||
|
||||
void copyDataFrom(const Group* other);
|
||||
QString print(bool recursive = false, bool flatten = false, int depth = 0);
|
||||
|
|
|
@ -262,13 +262,13 @@ bool GroupModel::dropMimeData(const QMimeData* data,
|
|||
targetDb->metadata()->copyCustomIcons(customIcons, sourceDb->metadata());
|
||||
|
||||
// Always clone the group across db's to reset UUIDs
|
||||
group = dragGroup->clone();
|
||||
group = dragGroup->clone(Entry::CloneDefault | Entry::CloneIncludeHistory);
|
||||
if (action == Qt::MoveAction) {
|
||||
// Remove the original group from the sourceDb
|
||||
delete dragGroup;
|
||||
}
|
||||
} else if (action == Qt::CopyAction) {
|
||||
group = dragGroup->clone();
|
||||
group = dragGroup->clone(Entry::CloneCopy);
|
||||
}
|
||||
|
||||
group->setParent(parentGroup, row);
|
||||
|
@ -303,13 +303,13 @@ bool GroupModel::dropMimeData(const QMimeData* data,
|
|||
targetDb->metadata()->addCustomIcon(customIcon, sourceDb->metadata()->customIcon(customIcon));
|
||||
}
|
||||
|
||||
// Always clone the entry across db's to reset the UUID
|
||||
entry = dragEntry->clone();
|
||||
// Reset the UUID when moving across db boundary
|
||||
entry = dragEntry->clone(Entry::CloneDefault | Entry::CloneIncludeHistory);
|
||||
if (action == Qt::MoveAction) {
|
||||
delete dragEntry;
|
||||
}
|
||||
} else if (action == Qt::CopyAction) {
|
||||
entry = dragEntry->clone();
|
||||
entry = dragEntry->clone(Entry::CloneCopy);
|
||||
}
|
||||
|
||||
entry->setGroup(parentGroup);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue