Document clone() methods.

This commit is contained in:
Felix Geyer 2013-07-04 13:59:32 +02:00
parent 74e912ccd3
commit cb804eb143
3 changed files with 13 additions and 3 deletions

View File

@ -110,6 +110,12 @@ public:
void addHistoryItem(Entry* entry);
void removeHistoryItems(const QList<Entry*>& historyEntries);
void truncateHistory();
/**
* Creates a duplicate of this entry except that returned entry isn't part
* of any group and all TimeInfo attributes are set to the current time.
* Note that you need to copy the custom icons manually when inserting the
* new entry into another database.
*/
Entry* clone() const;
void copyDataFrom(const Entry* other);
QString resolvePlaceholders(const QString& str) const;

View File

@ -466,9 +466,6 @@ QSet<Uuid> Group::customIconsRecursive() const
Group* Group::clone() const
{
// TODO: what to do about custom icons?
// they won't be available when changing the database later
Group* clonedGroup = new Group();
clonedGroup->setUpdateTimeinfo(false);

View File

@ -100,6 +100,13 @@ public:
QList<Entry*> entriesRecursive(bool includeHistoryItems = false) const;
QList<const Group*> groupsRecursive(bool includeSelf) const;
QSet<Uuid> customIconsRecursive() const;
/**
* Creates a duplicate of this group including all child entries and groups.
* The exceptions are that the returned group doesn't have a parent group
* and all TimeInfo attributes are set to the current time.
* Note that you need to copy the custom icons manually when inserting the
* new group into another database.
*/
Group* clone() const;
void copyDataFrom(const Group* other);