mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Implement KDBX 4.1 group tags
This commit is contained in:
parent
cd9ef58e98
commit
e5822974ac
BIN
share/demo.kdbx
BIN
share/demo.kdbx
Binary file not shown.
@ -125,6 +125,11 @@ QString Group::notes() const
|
|||||||
return m_data.notes;
|
return m_data.notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Group::tags() const
|
||||||
|
{
|
||||||
|
return m_data.tags;
|
||||||
|
}
|
||||||
|
|
||||||
int Group::iconNumber() const
|
int Group::iconNumber() const
|
||||||
{
|
{
|
||||||
return m_data.iconNumber;
|
return m_data.iconNumber;
|
||||||
@ -319,6 +324,11 @@ void Group::setNotes(const QString& notes)
|
|||||||
set(m_data.notes, notes);
|
set(m_data.notes, notes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Group::setTags(const QString& tags)
|
||||||
|
{
|
||||||
|
set(m_data.tags, tags);
|
||||||
|
}
|
||||||
|
|
||||||
void Group::setIcon(int iconNumber)
|
void Group::setIcon(int iconNumber)
|
||||||
{
|
{
|
||||||
if (iconNumber >= 0 && (m_data.iconNumber != iconNumber || !m_data.customIcon.isNull())) {
|
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) {
|
if (::compare(notes, other.notes, options) != 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (::compare(tags, other.tags, options) != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (::compare(iconNumber, other.iconNumber) != 0) {
|
if (::compare(iconNumber, other.iconNumber) != 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
Group::TriState autoTypeEnabled;
|
Group::TriState autoTypeEnabled;
|
||||||
Group::TriState searchingEnabled;
|
Group::TriState searchingEnabled;
|
||||||
Group::MergeMode mergeMode;
|
Group::MergeMode mergeMode;
|
||||||
|
QString tags;
|
||||||
QUuid previousParentGroupUuid;
|
QUuid previousParentGroupUuid;
|
||||||
|
|
||||||
bool operator==(const GroupData& other) const;
|
bool operator==(const GroupData& other) const;
|
||||||
@ -83,6 +84,7 @@ public:
|
|||||||
const QString uuidToHex() const;
|
const QString uuidToHex() const;
|
||||||
QString name() const;
|
QString name() const;
|
||||||
QString notes() const;
|
QString notes() const;
|
||||||
|
QString tags() const;
|
||||||
int iconNumber() const;
|
int iconNumber() const;
|
||||||
const QUuid& iconUuid() const;
|
const QUuid& iconUuid() const;
|
||||||
const TimeInfo& timeInfo() const;
|
const TimeInfo& timeInfo() const;
|
||||||
@ -122,6 +124,7 @@ public:
|
|||||||
void setUuid(const QUuid& uuid);
|
void setUuid(const QUuid& uuid);
|
||||||
void setName(const QString& name);
|
void setName(const QString& name);
|
||||||
void setNotes(const QString& notes);
|
void setNotes(const QString& notes);
|
||||||
|
void setTags(const QString& tags);
|
||||||
void setIcon(int iconNumber);
|
void setIcon(int iconNumber);
|
||||||
void setIcon(const QUuid& uuid);
|
void setIcon(const QUuid& uuid);
|
||||||
void setTimeInfo(const TimeInfo& timeInfo);
|
void setTimeInfo(const TimeInfo& timeInfo);
|
||||||
|
@ -502,6 +502,10 @@ Group* KdbxXmlReader::parseGroup()
|
|||||||
group->setNotes(readString());
|
group->setNotes(readString());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (m_xml.name() == "Tags") {
|
||||||
|
group->setTags(readString());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (m_xml.name() == "IconID") {
|
if (m_xml.name() == "IconID") {
|
||||||
int iconId = readNumber();
|
int iconId = readNumber();
|
||||||
if (iconId < 0) {
|
if (iconId < 0) {
|
||||||
|
@ -259,6 +259,9 @@ void KdbxXmlWriter::writeGroup(const Group* group)
|
|||||||
writeUuid("UUID", group->uuid());
|
writeUuid("UUID", group->uuid());
|
||||||
writeString("Name", group->name());
|
writeString("Name", group->name());
|
||||||
writeString("Notes", group->notes());
|
writeString("Notes", group->notes());
|
||||||
|
if (!group->tags().isEmpty()) {
|
||||||
|
writeString("Tags", group->tags());
|
||||||
|
}
|
||||||
writeNumber("IconID", group->iconNumber());
|
writeNumber("IconID", group->iconNumber());
|
||||||
|
|
||||||
if (!group->iconUuid().isNull()) {
|
if (!group->iconUuid().isNull()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user