mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Add Merge database utility function (#47)
Thank you to @TheZ3ro and @monomon for there major contributions to this PR!
This commit is contained in:
@@ -34,6 +34,7 @@ class Group : public QObject
|
||||
|
||||
public:
|
||||
enum TriState { Inherit, Enable, Disable };
|
||||
enum MergeMode { ModeInherit, KeepBoth, KeepNewer, KeepExisting };
|
||||
|
||||
struct GroupData
|
||||
{
|
||||
@@ -46,6 +47,7 @@ public:
|
||||
QString defaultAutoTypeSequence;
|
||||
Group::TriState autoTypeEnabled;
|
||||
Group::TriState searchingEnabled;
|
||||
Group::MergeMode mergeMode;
|
||||
};
|
||||
|
||||
Group();
|
||||
@@ -66,6 +68,7 @@ public:
|
||||
QString defaultAutoTypeSequence() const;
|
||||
Group::TriState autoTypeEnabled() const;
|
||||
Group::TriState searchingEnabled() const;
|
||||
Group::MergeMode mergeMode() const;
|
||||
bool resolveSearchingEnabled() const;
|
||||
bool resolveAutoTypeEnabled() const;
|
||||
Entry* lastTopVisibleEntry() const;
|
||||
@@ -74,6 +77,8 @@ public:
|
||||
static const int DefaultIconNumber;
|
||||
static const int RecycleBinIconNumber;
|
||||
|
||||
Entry* findEntry(const Uuid& uuid);
|
||||
Group* findChildByName(const QString& name);
|
||||
void setUuid(const Uuid& uuid);
|
||||
void setName(const QString& name);
|
||||
void setNotes(const QString& notes);
|
||||
@@ -87,6 +92,7 @@ public:
|
||||
void setLastTopVisibleEntry(Entry* entry);
|
||||
void setExpires(bool value);
|
||||
void setExpiryTime(const QDateTime& dateTime);
|
||||
void setMergeMode(MergeMode newMode);
|
||||
|
||||
void setUpdateTimeinfo(bool value);
|
||||
|
||||
@@ -113,6 +119,7 @@ public:
|
||||
*/
|
||||
Group* clone(Entry::CloneFlags entryFlags = Entry::CloneNewUuid | Entry::CloneResetTimeInfo) const;
|
||||
void copyDataFrom(const Group* other);
|
||||
void merge(const Group* other);
|
||||
|
||||
Q_SIGNALS:
|
||||
void dataChanged(Group* group);
|
||||
@@ -142,6 +149,8 @@ private:
|
||||
void addEntry(Entry* entry);
|
||||
void removeEntry(Entry* entry);
|
||||
void setParent(Database* db);
|
||||
void markOlderEntry(Entry* entry);
|
||||
void resolveConflict(Entry* existingEntry, Entry* otherEntry);
|
||||
|
||||
void recSetDatabase(Database* db);
|
||||
void cleanupParent();
|
||||
|
||||
Reference in New Issue
Block a user