mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Introduced missing CustomData on Group and Entry
Introduce missing CustomData-attributes of KDBX4 format to allow storing of plugin data for groups and entries - adopt Metadata to use the same storage mechanism Add simple view for CustomData as part of EditWidgetProperties Tracking of CustomData-Modification using SIGNAL-SLOT update-mechanism
This commit is contained in:
committed by
Janek Bevendorff
parent
698b44f71c
commit
0b54710734
@@ -129,7 +129,7 @@ void KdbxXmlWriter::writeMetadata()
|
||||
if (m_kdbxVersion < KeePass2::FILE_VERSION_4) {
|
||||
writeBinaries();
|
||||
}
|
||||
writeCustomData();
|
||||
writeCustomData(m_meta->customData());
|
||||
|
||||
m_xml.writeEndElement();
|
||||
}
|
||||
@@ -218,14 +218,13 @@ void KdbxXmlWriter::writeBinaries()
|
||||
m_xml.writeEndElement();
|
||||
}
|
||||
|
||||
void KdbxXmlWriter::writeCustomData()
|
||||
void KdbxXmlWriter::writeCustomData(const CustomData *customData)
|
||||
{
|
||||
m_xml.writeStartElement("CustomData");
|
||||
|
||||
QHash<QString, QString> customFields = m_meta->customFields();
|
||||
const QList<QString> keyList = customFields.keys();
|
||||
const QList<QString> keyList = customData->keys();
|
||||
for (const QString& key : keyList) {
|
||||
writeCustomDataItem(key, customFields.value(key));
|
||||
writeCustomDataItem(key, customData->value(key));
|
||||
}
|
||||
|
||||
m_xml.writeEndElement();
|
||||
@@ -277,6 +276,10 @@ void KdbxXmlWriter::writeGroup(const Group* group)
|
||||
|
||||
writeUuid("LastTopVisibleEntry", group->lastTopVisibleEntry());
|
||||
|
||||
if (!group->customData()->isEmpty()){
|
||||
writeCustomData(group->customData());
|
||||
}
|
||||
|
||||
const QList<Entry*>& entryList = group->entries();
|
||||
for (const Entry* entry : entryList) {
|
||||
writeEntry(entry);
|
||||
@@ -401,6 +404,11 @@ void KdbxXmlWriter::writeEntry(const Entry* entry)
|
||||
}
|
||||
|
||||
writeAutoType(entry);
|
||||
|
||||
if (!entry->customData()->isEmpty()){
|
||||
writeCustomData(entry->customData());
|
||||
}
|
||||
|
||||
// write history only for entries that are not history items
|
||||
if (entry->parent()) {
|
||||
writeEntryHistory(entry);
|
||||
|
||||
Reference in New Issue
Block a user