mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-11 00:34:30 -05:00
Prevent unnecessary memory allocations
This commit is contained in:
parent
852e89c0df
commit
be312bbe4f
@ -418,7 +418,7 @@ Database* Database::unlockFromStdin(QString databaseFilename, QString keyFilenam
|
|||||||
FileKey fileKey;
|
FileKey fileKey;
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!fileKey.load(keyFilename, &errorMessage)) {
|
if (!fileKey.load(keyFilename, &errorMessage)) {
|
||||||
errorTextStream << QObject::tr("Failed to load key file %1 : %2").arg(keyFilename).arg(errorMessage);
|
errorTextStream << QObject::tr("Failed to load key file %1 : %2").arg(keyFilename, errorMessage);
|
||||||
errorTextStream << endl;
|
errorTextStream << endl;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ QList<QString> EntryAttachments::keys() const
|
|||||||
|
|
||||||
bool EntryAttachments::hasKey(const QString& key) const
|
bool EntryAttachments::hasKey(const QString& key) const
|
||||||
{
|
{
|
||||||
return m_attachments.keys().contains(key);
|
return m_attachments.contains(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QByteArray> EntryAttachments::values() const
|
QList<QByteArray> EntryAttachments::values() const
|
||||||
|
@ -41,7 +41,7 @@ QList<QString> EntryAttributes::keys() const
|
|||||||
|
|
||||||
bool EntryAttributes::hasKey(const QString& key) const
|
bool EntryAttributes::hasKey(const QString& key) const
|
||||||
{
|
{
|
||||||
return m_attributes.keys().contains(key);
|
return m_attributes.contains(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QString> EntryAttributes::customKeys()
|
QList<QString> EntryAttributes::customKeys()
|
||||||
|
@ -521,9 +521,9 @@ void KeePass2XmlWriter::writeColor(const QString& qualifiedName, const QColor& c
|
|||||||
QString colorStr;
|
QString colorStr;
|
||||||
|
|
||||||
if (color.isValid()) {
|
if (color.isValid()) {
|
||||||
colorStr = QString("#%1%2%3").arg(colorPartToString(color.red()))
|
colorStr = QString("#%1%2%3").arg(colorPartToString(color.red()),
|
||||||
.arg(colorPartToString(color.green()))
|
colorPartToString(color.green()),
|
||||||
.arg(colorPartToString(color.blue()));
|
colorPartToString(color.blue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
writeString(qualifiedName, colorStr);
|
writeString(qualifiedName, colorStr);
|
||||||
|
@ -59,16 +59,16 @@ AboutDialog::AboutDialog(QWidget* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
debugInfo.append(QString("%1\n- Qt %2\n- %3\n\n")
|
debugInfo.append(QString("%1\n- Qt %2\n- %3\n\n")
|
||||||
.arg(tr("Libraries:"))
|
.arg(tr("Libraries:"),
|
||||||
.arg(QString::fromLocal8Bit(qVersion()))
|
QString::fromLocal8Bit(qVersion()),
|
||||||
.arg(Crypto::backendVersion()));
|
Crypto::backendVersion()));
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
||||||
debugInfo.append(tr("Operating system: %1\nCPU architecture: %2\nKernel: %3 %4")
|
debugInfo.append(tr("Operating system: %1\nCPU architecture: %2\nKernel: %3 %4")
|
||||||
.arg(QSysInfo::prettyProductName())
|
.arg(QSysInfo::prettyProductName(),
|
||||||
.arg(QSysInfo::currentCpuArchitecture())
|
QSysInfo::currentCpuArchitecture(),
|
||||||
.arg(QSysInfo::kernelType())
|
QSysInfo::kernelType(),
|
||||||
.arg(QSysInfo::kernelVersion()));
|
QSysInfo::kernelVersion()));
|
||||||
|
|
||||||
debugInfo.append("\n\n");
|
debugInfo.append("\n\n");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user