mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 08:19:47 -05:00
Avoid creation of temporary containers
This commit is contained in:
parent
39b96c13e8
commit
2cf837801d
@ -91,7 +91,8 @@ void Config::sync()
|
||||
|
||||
void Config::upgrade()
|
||||
{
|
||||
for (const auto& setting : deprecationMap.keys()) {
|
||||
const auto keys = deprecationMap.keys();
|
||||
for (const auto& setting : keys) {
|
||||
if (m_settings->contains(setting)) {
|
||||
if (!deprecationMap.value(setting).isEmpty()) {
|
||||
// Add entry with new name and old entry's value
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
#include "CustomData.h"
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
CustomData::CustomData(QObject* parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
@ -44,7 +46,7 @@ bool CustomData::contains(const QString& key) const
|
||||
|
||||
bool CustomData::containsValue(const QString& value) const
|
||||
{
|
||||
return m_data.values().contains(value);
|
||||
return asConst(m_data).values().contains(value);
|
||||
}
|
||||
|
||||
void CustomData::set(const QString& key, const QString& value)
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
#include "EntryAttachments.h"
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
#include <QSet>
|
||||
#include <QStringList>
|
||||
|
||||
@ -37,7 +39,7 @@ bool EntryAttachments::hasKey(const QString& key) const
|
||||
|
||||
QSet<QByteArray> EntryAttachments::values() const
|
||||
{
|
||||
return m_attachments.values().toSet();
|
||||
return asConst(m_attachments).values().toSet();
|
||||
}
|
||||
|
||||
QByteArray EntryAttachments::value(const QString& key) const
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "EntryAttributes.h"
|
||||
|
||||
#include "core/Global.h"
|
||||
|
||||
const QString EntryAttributes::TitleKey = "Title";
|
||||
const QString EntryAttributes::UserNameKey = "UserName";
|
||||
const QString EntryAttributes::PasswordKey = "Password";
|
||||
@ -72,7 +74,7 @@ bool EntryAttributes::contains(const QString& key) const
|
||||
|
||||
bool EntryAttributes::containsValue(const QString& value) const
|
||||
{
|
||||
return m_attributes.values().contains(value);
|
||||
return asConst(m_attributes).values().contains(value);
|
||||
}
|
||||
|
||||
bool EntryAttributes::isProtected(const QString& key) const
|
||||
|
@ -616,7 +616,8 @@ Merger::ChangeList Merger::mergeMetadata(const MergeContext& context)
|
||||
auto* sourceMetadata = context.m_sourceDb->metadata();
|
||||
auto* targetMetadata = context.m_targetDb->metadata();
|
||||
|
||||
for (QUuid customIconId : sourceMetadata->customIcons().keys()) {
|
||||
const auto keys = sourceMetadata->customIcons().keys();
|
||||
for (QUuid customIconId : keys) {
|
||||
QImage customIcon = sourceMetadata->customIcon(customIconId);
|
||||
if (!targetMetadata->containsCustomIcon(customIconId)) {
|
||||
targetMetadata->addCustomIcon(customIconId, customIcon);
|
||||
|
@ -124,8 +124,8 @@ void KdbxXmlReader::readDatabase(QIODevice* device, Database* db, KeePass2Random
|
||||
qWarning("KdbxXmlReader::readDatabase: found %d invalid entry reference(s)", m_tmpParent->children().size());
|
||||
}
|
||||
|
||||
const QSet<QString> poolKeys = m_binaryPool.keys().toSet();
|
||||
const QSet<QString> entryKeys = m_binaryMap.keys().toSet();
|
||||
const QSet<QString> poolKeys = asConst(m_binaryPool).keys().toSet();
|
||||
const QSet<QString> entryKeys = asConst(m_binaryMap).keys().toSet();
|
||||
const QSet<QString> unmappedKeys = entryKeys - poolKeys;
|
||||
const QSet<QString> unusedKeys = poolKeys - entryKeys;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user