diff --git a/share/demo.kdbx b/share/demo.kdbx index 053dc29d7..7c51608ef 100644 Binary files a/share/demo.kdbx and b/share/demo.kdbx differ diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 359b925ab..d0c87b3e2 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -125,6 +125,11 @@ QString Group::notes() const return m_data.notes; } +QString Group::tags() const +{ + return m_data.tags; +} + int Group::iconNumber() const { return m_data.iconNumber; @@ -319,6 +324,11 @@ void Group::setNotes(const QString& notes) set(m_data.notes, notes); } +void Group::setTags(const QString& tags) +{ + set(m_data.tags, tags); +} + void Group::setIcon(int iconNumber) { if (iconNumber >= 0 && (m_data.iconNumber != iconNumber || !m_data.customIcon.isNull())) { @@ -1228,6 +1238,9 @@ bool Group::GroupData::equals(const Group::GroupData& other, CompareItemOptions if (::compare(notes, other.notes, options) != 0) { return false; } + if (::compare(tags, other.tags, options) != 0) { + return false; + } if (::compare(iconNumber, other.iconNumber) != 0) { return false; } diff --git a/src/core/Group.h b/src/core/Group.h index 5c7321b41..748437ab1 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -69,6 +69,7 @@ public: Group::TriState autoTypeEnabled; Group::TriState searchingEnabled; Group::MergeMode mergeMode; + QString tags; QUuid previousParentGroupUuid; bool operator==(const GroupData& other) const; @@ -83,6 +84,7 @@ public: const QString uuidToHex() const; QString name() const; QString notes() const; + QString tags() const; int iconNumber() const; const QUuid& iconUuid() const; const TimeInfo& timeInfo() const; @@ -122,6 +124,7 @@ public: void setUuid(const QUuid& uuid); void setName(const QString& name); void setNotes(const QString& notes); + void setTags(const QString& tags); void setIcon(int iconNumber); void setIcon(const QUuid& uuid); void setTimeInfo(const TimeInfo& timeInfo); diff --git a/src/format/KdbxXmlReader.cpp b/src/format/KdbxXmlReader.cpp index 504a8db81..5319323d2 100644 --- a/src/format/KdbxXmlReader.cpp +++ b/src/format/KdbxXmlReader.cpp @@ -502,6 +502,10 @@ Group* KdbxXmlReader::parseGroup() group->setNotes(readString()); continue; } + if (m_xml.name() == "Tags") { + group->setTags(readString()); + continue; + } if (m_xml.name() == "IconID") { int iconId = readNumber(); if (iconId < 0) { diff --git a/src/format/KdbxXmlWriter.cpp b/src/format/KdbxXmlWriter.cpp index 5ddfe40d8..37f7a7b26 100644 --- a/src/format/KdbxXmlWriter.cpp +++ b/src/format/KdbxXmlWriter.cpp @@ -259,6 +259,9 @@ void KdbxXmlWriter::writeGroup(const Group* group) writeUuid("UUID", group->uuid()); writeString("Name", group->name()); writeString("Notes", group->notes()); + if (!group->tags().isEmpty()) { + writeString("Tags", group->tags()); + } writeNumber("IconID", group->iconNumber()); if (!group->iconUuid().isNull()) {