mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 01:07:27 -05:00
parent
ef26065a99
commit
baed7d76cf
@ -82,18 +82,21 @@ void KeePass2XmlReader::readDatabase(QIODevice* device, Database* db, KeePass2Ra
|
|||||||
|
|
||||||
QHash<QString, QPair<Entry*, QString> >::const_iterator i;
|
QHash<QString, QPair<Entry*, QString> >::const_iterator i;
|
||||||
for (i = m_binaryMap.constBegin(); i != m_binaryMap.constEnd(); ++i) {
|
for (i = m_binaryMap.constBegin(); i != m_binaryMap.constEnd(); ++i) {
|
||||||
QPair<Entry*, QString> target = i.value();
|
const QPair<Entry*, QString>& target = i.value();
|
||||||
target.first->attachments()->set(target.second, m_binaryPool[i.key()]);
|
target.first->attachments()->set(target.second, m_binaryPool[i.key()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_meta->setUpdateDatetime(true);
|
m_meta->setUpdateDatetime(true);
|
||||||
Q_FOREACH (Group* group, m_groups) {
|
QHash<Uuid, Group*>::const_iterator iGroup;
|
||||||
group->setUpdateTimeinfo(true);
|
for (iGroup = m_groups.constBegin(); iGroup != m_groups.constEnd(); ++iGroup) {
|
||||||
|
iGroup.value()->setUpdateTimeinfo(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_FOREACH (Entry* entry, m_entries) {
|
QHash<Uuid, Entry*>::const_iterator iEntry;
|
||||||
entry->setUpdateTimeinfo(true);
|
for (iEntry = m_entries.constBegin(); iEntry != m_entries.constEnd(); ++iEntry) {
|
||||||
Q_FOREACH(Entry* histEntry, entry->historyItems()) {
|
iEntry.value()->setUpdateTimeinfo(true);
|
||||||
|
|
||||||
|
Q_FOREACH (Entry* histEntry, iEntry.value()->historyItems()) {
|
||||||
histEntry->setUpdateTimeinfo(true);
|
histEntry->setUpdateTimeinfo(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -895,18 +898,17 @@ Group* KeePass2XmlReader::getGroup(const Uuid& uuid)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_FOREACH (Group* group, m_groups) {
|
if (m_groups.contains(uuid)) {
|
||||||
if (group->uuid() == uuid) {
|
return m_groups.value(uuid);
|
||||||
return group;
|
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
|
|
||||||
Group* group = new Group();
|
Group* group = new Group();
|
||||||
group->setUpdateTimeinfo(false);
|
group->setUpdateTimeinfo(false);
|
||||||
group->setUuid(uuid);
|
group->setUuid(uuid);
|
||||||
group->setParent(m_tmpParent);
|
group->setParent(m_tmpParent);
|
||||||
m_groups << group;
|
m_groups.insert(uuid, group);
|
||||||
return group;
|
return group;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry* KeePass2XmlReader::getEntry(const Uuid& uuid)
|
Entry* KeePass2XmlReader::getEntry(const Uuid& uuid)
|
||||||
@ -915,18 +917,17 @@ Entry* KeePass2XmlReader::getEntry(const Uuid& uuid)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_FOREACH (Entry* entry, m_entries) {
|
if (m_entries.contains(uuid)) {
|
||||||
if (entry->uuid() == uuid) {
|
return m_entries.value(uuid);
|
||||||
return entry;
|
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
|
|
||||||
Entry* entry = new Entry();
|
Entry* entry = new Entry();
|
||||||
entry->setUpdateTimeinfo(false);
|
entry->setUpdateTimeinfo(false);
|
||||||
entry->setUuid(uuid);
|
entry->setUuid(uuid);
|
||||||
entry->setGroup(m_tmpParent);
|
entry->setGroup(m_tmpParent);
|
||||||
m_entries << entry;
|
m_entries.insert(uuid, entry);
|
||||||
return entry;
|
return entry;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeePass2XmlReader::raiseError(int internalNumber)
|
void KeePass2XmlReader::raiseError(int internalNumber)
|
||||||
|
@ -87,8 +87,8 @@ private:
|
|||||||
Database* m_db;
|
Database* m_db;
|
||||||
Metadata* m_meta;
|
Metadata* m_meta;
|
||||||
Group* m_tmpParent;
|
Group* m_tmpParent;
|
||||||
QList<Group*> m_groups;
|
QHash<Uuid, Group*> m_groups;
|
||||||
QList<Entry*> m_entries;
|
QHash<Uuid, Entry*> m_entries;
|
||||||
QHash<QString, QByteArray> m_binaryPool;
|
QHash<QString, QByteArray> m_binaryPool;
|
||||||
QHash<QString, QPair<Entry*, QString> > m_binaryMap;
|
QHash<QString, QPair<Entry*, QString> > m_binaryMap;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user