Extracting default clone flags.

This commit is contained in:
Louis-Bertrand Varin 2017-11-21 14:02:21 -05:00
parent 2ff56fe86c
commit 94ea323836
2 changed files with 11 additions and 6 deletions

View File

@ -26,6 +26,11 @@
const int Group::DefaultIconNumber = 48;
const int Group::RecycleBinIconNumber = 43;
Group::CloneFlags Group::DefaultCloneFlags = static_cast<Group::CloneFlags>(
Group::CloneNewUuid | Group::CloneResetTimeInfo | Group::CloneIncludeEntries);
Entry::CloneFlags Group::DefaultEntryCloneFlags = static_cast<Entry::CloneFlags>(
Entry::CloneNewUuid | Entry::CloneResetTimeInfo);
Group::Group()
: m_updateTimeinfo(true)
{

View File

@ -86,6 +86,8 @@ public:
static const int DefaultIconNumber;
static const int RecycleBinIconNumber;
static CloneFlags DefaultCloneFlags;
static Entry::CloneFlags DefaultEntryCloneFlags;
Group* findChildByName(const QString& name);
Group* findChildByUuid(const Uuid& uuid);
@ -128,15 +130,13 @@ public:
QList<Group*> groupsRecursive(bool includeSelf);
QSet<Uuid> customIconsRecursive() const;
/**
* Creates a duplicate of this group including all child entries and groups (if not shallow).
* The exceptions are that the returned group doesn't have a parent group
* and all TimeInfo attributes are set to the current time.
* Creates a duplicate of this group.
* Note that you need to copy the custom icons manually when inserting the
* new group into another database.
*/
Group* clone(Entry::CloneFlags entryFlags = Entry::CloneNewUuid | Entry::CloneResetTimeInfo,
CloneFlags groupFlags = static_cast<CloneFlags>(Group::CloneNewUuid | Group::CloneResetTimeInfo |
Group::CloneIncludeEntries)) const;
Group* clone(
Entry::CloneFlags entryFlags = DefaultEntryCloneFlags, CloneFlags groupFlags = DefaultCloneFlags) const;
void copyDataFrom(const Group* other);
void merge(const Group* other);
QString print(bool recursive = false, int depth = 0);