mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Support writing empty color.
This commit is contained in:
parent
2adf3770b0
commit
fd9685037b
@ -386,6 +386,8 @@ void KeePass2XmlWriter::writeBool(const QString& qualifiedName, bool b)
|
||||
|
||||
void KeePass2XmlWriter::writeDateTime(const QString& qualifiedName, const QDateTime& dateTime)
|
||||
{
|
||||
Q_ASSERT(dateTime.isValid());
|
||||
|
||||
writeString(qualifiedName, dateTime.toUTC().toString(Qt::ISODate).append('Z'));
|
||||
}
|
||||
|
||||
@ -421,9 +423,13 @@ void KeePass2XmlWriter::writeBinary(const QString& qualifiedName, const QByteArr
|
||||
|
||||
void KeePass2XmlWriter::writeColor(const QString& qualifiedName, const QColor& color)
|
||||
{
|
||||
QString colorStr = QString("#%1%2%3").arg(colorPartToString(color.red()))
|
||||
.arg(colorPartToString(color.green()))
|
||||
.arg(colorPartToString(color.blue()));
|
||||
QString colorStr;
|
||||
|
||||
if (color.isValid()) {
|
||||
colorStr = QString("#%1%2%3").arg(colorPartToString(color.red()))
|
||||
.arg(colorPartToString(color.green()))
|
||||
.arg(colorPartToString(color.blue()));
|
||||
}
|
||||
|
||||
writeString(qualifiedName, colorStr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user