mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-23 07:59:54 -05:00
Removing QColor (from Qt::Widgets) from core modules. (#4247)
This commit is contained in:
parent
8bac8a7163
commit
c8ab3b5f4f
@ -15,24 +15,3 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "Compare.h"
|
#include "Compare.h"
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
|
|
||||||
bool operator<(const QColor& lhs, const QColor& rhs)
|
|
||||||
{
|
|
||||||
const QColor adaptedLhs = lhs.toCmyk();
|
|
||||||
const QColor adaptedRhs = rhs.toCmyk();
|
|
||||||
const int iCyan = compare(adaptedLhs.cyanF(), adaptedRhs.cyanF());
|
|
||||||
if (iCyan != 0) {
|
|
||||||
return iCyan;
|
|
||||||
}
|
|
||||||
const int iMagenta = compare(adaptedLhs.magentaF(), adaptedRhs.magentaF());
|
|
||||||
if (iMagenta != 0) {
|
|
||||||
return iMagenta;
|
|
||||||
}
|
|
||||||
const int iYellow = compare(adaptedLhs.yellowF(), adaptedRhs.yellowF());
|
|
||||||
if (iYellow != 0) {
|
|
||||||
return iYellow;
|
|
||||||
}
|
|
||||||
return compare(adaptedLhs.blackF(), adaptedRhs.blackF()) < 0;
|
|
||||||
}
|
|
||||||
|
@ -34,14 +34,6 @@ enum CompareItemOption
|
|||||||
Q_DECLARE_FLAGS(CompareItemOptions, CompareItemOption)
|
Q_DECLARE_FLAGS(CompareItemOptions, CompareItemOption)
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(CompareItemOptions)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(CompareItemOptions)
|
||||||
|
|
||||||
class QColor;
|
|
||||||
/*!
|
|
||||||
* \return true when both color match
|
|
||||||
*
|
|
||||||
* Comparison converts both into the cmyk-model
|
|
||||||
*/
|
|
||||||
bool operator<(const QColor& lhs, const QColor& rhs);
|
|
||||||
|
|
||||||
template <typename Type> inline short compareGeneric(const Type& lhs, const Type& rhs, CompareItemOptions)
|
template <typename Type> inline short compareGeneric(const Type& lhs, const Type& rhs, CompareItemOptions)
|
||||||
{
|
{
|
||||||
if (lhs != rhs) {
|
if (lhs != rhs) {
|
||||||
|
@ -208,12 +208,12 @@ const QUuid& Entry::iconUuid() const
|
|||||||
return m_data.customIcon;
|
return m_data.customIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor Entry::foregroundColor() const
|
QString Entry::foregroundColor() const
|
||||||
{
|
{
|
||||||
return m_data.foregroundColor;
|
return m_data.foregroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor Entry::backgroundColor() const
|
QString Entry::backgroundColor() const
|
||||||
{
|
{
|
||||||
return m_data.backgroundColor;
|
return m_data.backgroundColor;
|
||||||
}
|
}
|
||||||
@ -508,14 +508,14 @@ void Entry::setIcon(const QUuid& uuid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entry::setForegroundColor(const QColor& color)
|
void Entry::setForegroundColor(const QString& colorStr)
|
||||||
{
|
{
|
||||||
set(m_data.foregroundColor, color);
|
set(m_data.foregroundColor, colorStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entry::setBackgroundColor(const QColor& color)
|
void Entry::setBackgroundColor(const QString& colorStr)
|
||||||
{
|
{
|
||||||
set(m_data.backgroundColor, color);
|
set(m_data.backgroundColor, colorStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entry::setOverrideUrl(const QString& url)
|
void Entry::setOverrideUrl(const QString& url)
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#ifndef KEEPASSX_ENTRY_H
|
#ifndef KEEPASSX_ENTRY_H
|
||||||
#define KEEPASSX_ENTRY_H
|
#define KEEPASSX_ENTRY_H
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
@ -57,8 +56,8 @@ struct EntryData
|
|||||||
{
|
{
|
||||||
int iconNumber;
|
int iconNumber;
|
||||||
QUuid customIcon;
|
QUuid customIcon;
|
||||||
QColor foregroundColor;
|
QString foregroundColor;
|
||||||
QColor backgroundColor;
|
QString backgroundColor;
|
||||||
QString overrideUrl;
|
QString overrideUrl;
|
||||||
QString tags;
|
QString tags;
|
||||||
bool autoTypeEnabled;
|
bool autoTypeEnabled;
|
||||||
@ -86,8 +85,8 @@ public:
|
|||||||
QPixmap iconScaledPixmap() const;
|
QPixmap iconScaledPixmap() const;
|
||||||
int iconNumber() const;
|
int iconNumber() const;
|
||||||
const QUuid& iconUuid() const;
|
const QUuid& iconUuid() const;
|
||||||
QColor foregroundColor() const;
|
QString foregroundColor() const;
|
||||||
QColor backgroundColor() const;
|
QString backgroundColor() const;
|
||||||
QString overrideUrl() const;
|
QString overrideUrl() const;
|
||||||
QString tags() const;
|
QString tags() const;
|
||||||
const TimeInfo& timeInfo() const;
|
const TimeInfo& timeInfo() const;
|
||||||
@ -132,8 +131,8 @@ public:
|
|||||||
void setUuid(const QUuid& uuid);
|
void setUuid(const QUuid& uuid);
|
||||||
void setIcon(int iconNumber);
|
void setIcon(int iconNumber);
|
||||||
void setIcon(const QUuid& uuid);
|
void setIcon(const QUuid& uuid);
|
||||||
void setForegroundColor(const QColor& color);
|
void setForegroundColor(const QString& color);
|
||||||
void setBackgroundColor(const QColor& color);
|
void setBackgroundColor(const QString& color);
|
||||||
void setOverrideUrl(const QString& url);
|
void setOverrideUrl(const QString& url);
|
||||||
void setTags(const QString& tags);
|
void setTags(const QString& tags);
|
||||||
void setTimeInfo(const TimeInfo& timeInfo);
|
void setTimeInfo(const TimeInfo& timeInfo);
|
||||||
|
@ -131,7 +131,7 @@ int Metadata::maintenanceHistoryDays() const
|
|||||||
return m_data.maintenanceHistoryDays;
|
return m_data.maintenanceHistoryDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor Metadata::color() const
|
QString Metadata::color() const
|
||||||
{
|
{
|
||||||
return m_data.color;
|
return m_data.color;
|
||||||
}
|
}
|
||||||
@ -347,7 +347,7 @@ void Metadata::setMaintenanceHistoryDays(int value)
|
|||||||
set(m_data.maintenanceHistoryDays, value);
|
set(m_data.maintenanceHistoryDays, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Metadata::setColor(const QColor& value)
|
void Metadata::setColor(const QString& value)
|
||||||
{
|
{
|
||||||
set(m_data.color, value);
|
set(m_data.color, value);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#ifndef KEEPASSX_METADATA_H
|
#ifndef KEEPASSX_METADATA_H
|
||||||
#define KEEPASSX_METADATA_H
|
#define KEEPASSX_METADATA_H
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
@ -49,7 +48,7 @@ public:
|
|||||||
QString defaultUserName;
|
QString defaultUserName;
|
||||||
QDateTime defaultUserNameChanged;
|
QDateTime defaultUserNameChanged;
|
||||||
int maintenanceHistoryDays;
|
int maintenanceHistoryDays;
|
||||||
QColor color;
|
QString color;
|
||||||
bool recycleBinEnabled;
|
bool recycleBinEnabled;
|
||||||
int historyMaxItems;
|
int historyMaxItems;
|
||||||
int historyMaxSize;
|
int historyMaxSize;
|
||||||
@ -72,7 +71,7 @@ public:
|
|||||||
QDateTime defaultUserNameChanged() const;
|
QDateTime defaultUserNameChanged() const;
|
||||||
QDateTime settingsChanged() const;
|
QDateTime settingsChanged() const;
|
||||||
int maintenanceHistoryDays() const;
|
int maintenanceHistoryDays() const;
|
||||||
QColor color() const;
|
QString color() const;
|
||||||
bool protectTitle() const;
|
bool protectTitle() const;
|
||||||
bool protectUsername() const;
|
bool protectUsername() const;
|
||||||
bool protectPassword() const;
|
bool protectPassword() const;
|
||||||
@ -113,7 +112,7 @@ public:
|
|||||||
void setDefaultUserNameChanged(const QDateTime& value);
|
void setDefaultUserNameChanged(const QDateTime& value);
|
||||||
void setSettingsChanged(const QDateTime& value);
|
void setSettingsChanged(const QDateTime& value);
|
||||||
void setMaintenanceHistoryDays(int value);
|
void setMaintenanceHistoryDays(int value);
|
||||||
void setColor(const QColor& value);
|
void setColor(const QString& value);
|
||||||
void setProtectTitle(bool value);
|
void setProtectTitle(bool value);
|
||||||
void setProtectUsername(bool value);
|
void setProtectUsername(bool value);
|
||||||
void setProtectPassword(bool value);
|
void setProtectPassword(bool value);
|
||||||
|
@ -1047,22 +1047,21 @@ QDateTime KdbxXmlReader::readDateTime()
|
|||||||
return Clock::currentDateTimeUtc();
|
return Clock::currentDateTimeUtc();
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor KdbxXmlReader::readColor()
|
QString KdbxXmlReader::readColor()
|
||||||
{
|
{
|
||||||
QString colorStr = readString();
|
QString colorStr = readString();
|
||||||
|
|
||||||
if (colorStr.isEmpty()) {
|
if (colorStr.isEmpty()) {
|
||||||
return {};
|
return colorStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colorStr.length() != 7 || colorStr[0] != '#') {
|
if (colorStr.length() != 7 || colorStr[0] != '#') {
|
||||||
if (m_strictMode) {
|
if (m_strictMode) {
|
||||||
raiseError(tr("Invalid color value"));
|
raiseError(tr("Invalid color value"));
|
||||||
}
|
}
|
||||||
return {};
|
return colorStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor color;
|
|
||||||
for (int i = 0; i <= 2; ++i) {
|
for (int i = 0; i <= 2; ++i) {
|
||||||
QString rgbPartStr = colorStr.mid(1 + 2 * i, 2);
|
QString rgbPartStr = colorStr.mid(1 + 2 * i, 2);
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -1071,19 +1070,11 @@ QColor KdbxXmlReader::readColor()
|
|||||||
if (m_strictMode) {
|
if (m_strictMode) {
|
||||||
raiseError(tr("Invalid color rgb part"));
|
raiseError(tr("Invalid color rgb part"));
|
||||||
}
|
}
|
||||||
return {};
|
return colorStr;
|
||||||
}
|
|
||||||
|
|
||||||
if (i == 0) {
|
|
||||||
color.setRed(rgbPart);
|
|
||||||
} else if (i == 1) {
|
|
||||||
color.setGreen(rgbPart);
|
|
||||||
} else {
|
|
||||||
color.setBlue(rgbPart);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return colorStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int KdbxXmlReader::readNumber()
|
int KdbxXmlReader::readNumber()
|
||||||
|
@ -83,7 +83,7 @@ protected:
|
|||||||
virtual QString readString(bool& isProtected, bool& protectInMemory);
|
virtual QString readString(bool& isProtected, bool& protectInMemory);
|
||||||
virtual bool readBool();
|
virtual bool readBool();
|
||||||
virtual QDateTime readDateTime();
|
virtual QDateTime readDateTime();
|
||||||
virtual QColor readColor();
|
virtual QString readColor();
|
||||||
virtual int readNumber();
|
virtual int readNumber();
|
||||||
virtual QUuid readUuid();
|
virtual QUuid readUuid();
|
||||||
virtual QByteArray readBinary();
|
virtual QByteArray readBinary();
|
||||||
|
@ -111,7 +111,7 @@ void KdbxXmlWriter::writeMetadata()
|
|||||||
writeString("DefaultUserName", m_meta->defaultUserName());
|
writeString("DefaultUserName", m_meta->defaultUserName());
|
||||||
writeDateTime("DefaultUserNameChanged", m_meta->defaultUserNameChanged());
|
writeDateTime("DefaultUserNameChanged", m_meta->defaultUserNameChanged());
|
||||||
writeNumber("MaintenanceHistoryDays", m_meta->maintenanceHistoryDays());
|
writeNumber("MaintenanceHistoryDays", m_meta->maintenanceHistoryDays());
|
||||||
writeColor("Color", m_meta->color());
|
writeString("Color", m_meta->color());
|
||||||
writeDateTime("MasterKeyChanged", m_meta->masterKeyChanged());
|
writeDateTime("MasterKeyChanged", m_meta->masterKeyChanged());
|
||||||
writeNumber("MasterKeyChangeRec", m_meta->masterKeyChangeRec());
|
writeNumber("MasterKeyChangeRec", m_meta->masterKeyChangeRec());
|
||||||
writeNumber("MasterKeyChangeForce", m_meta->masterKeyChangeForce());
|
writeNumber("MasterKeyChangeForce", m_meta->masterKeyChangeForce());
|
||||||
@ -346,8 +346,8 @@ void KdbxXmlWriter::writeEntry(const Entry* entry)
|
|||||||
if (!entry->iconUuid().isNull()) {
|
if (!entry->iconUuid().isNull()) {
|
||||||
writeUuid("CustomIconUUID", entry->iconUuid());
|
writeUuid("CustomIconUUID", entry->iconUuid());
|
||||||
}
|
}
|
||||||
writeColor("ForegroundColor", entry->foregroundColor());
|
writeString("ForegroundColor", entry->foregroundColor());
|
||||||
writeColor("BackgroundColor", entry->backgroundColor());
|
writeString("BackgroundColor", entry->backgroundColor());
|
||||||
writeString("OverrideURL", entry->overrideUrl());
|
writeString("OverrideURL", entry->overrideUrl());
|
||||||
writeString("Tags", entry->tags());
|
writeString("Tags", entry->tags());
|
||||||
writeTimes(entry->timeInfo());
|
writeTimes(entry->timeInfo());
|
||||||
@ -532,18 +532,6 @@ void KdbxXmlWriter::writeBinary(const QString& qualifiedName, const QByteArray&
|
|||||||
writeString(qualifiedName, QString::fromLatin1(ba.toBase64()));
|
writeString(qualifiedName, QString::fromLatin1(ba.toBase64()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void KdbxXmlWriter::writeColor(const QString& qualifiedName, const QColor& color)
|
|
||||||
{
|
|
||||||
QString colorStr;
|
|
||||||
|
|
||||||
if (color.isValid()) {
|
|
||||||
colorStr = QString("#%1%2%3").arg(
|
|
||||||
colorPartToString(color.red()), colorPartToString(color.green()), colorPartToString(color.blue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
writeString(qualifiedName, colorStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void KdbxXmlWriter::writeTriState(const QString& qualifiedName, Group::TriState triState)
|
void KdbxXmlWriter::writeTriState(const QString& qualifiedName, Group::TriState triState)
|
||||||
{
|
{
|
||||||
QString value;
|
QString value;
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#ifndef KEEPASSX_KDBXXMLWRITER_H
|
#ifndef KEEPASSX_KDBXXMLWRITER_H
|
||||||
#define KEEPASSX_KDBXXMLWRITER_H
|
#define KEEPASSX_KDBXXMLWRITER_H
|
||||||
|
|
||||||
#include <QColor>
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
@ -74,7 +73,6 @@ private:
|
|||||||
void writeUuid(const QString& qualifiedName, const Group* group);
|
void writeUuid(const QString& qualifiedName, const Group* group);
|
||||||
void writeUuid(const QString& qualifiedName, const Entry* entry);
|
void writeUuid(const QString& qualifiedName, const Entry* entry);
|
||||||
void writeBinary(const QString& qualifiedName, const QByteArray& ba);
|
void writeBinary(const QString& qualifiedName, const QByteArray& ba);
|
||||||
void writeColor(const QString& qualifiedName, const QColor& color);
|
|
||||||
void writeTriState(const QString& qualifiedName, Group::TriState triState);
|
void writeTriState(const QString& qualifiedName, Group::TriState triState);
|
||||||
QString colorPartToString(int value);
|
QString colorPartToString(int value);
|
||||||
QString stripInvalidXml10Chars(QString str);
|
QString stripInvalidXml10Chars(QString str);
|
||||||
|
@ -1123,15 +1123,15 @@ void EditEntryWidget::updateEntryData(Entry* entry) const
|
|||||||
entry->setNotes(m_mainUi->notesEdit->toPlainText());
|
entry->setNotes(m_mainUi->notesEdit->toPlainText());
|
||||||
|
|
||||||
if (m_advancedUi->fgColorCheckBox->isChecked() && m_advancedUi->fgColorButton->property("color").isValid()) {
|
if (m_advancedUi->fgColorCheckBox->isChecked() && m_advancedUi->fgColorButton->property("color").isValid()) {
|
||||||
entry->setForegroundColor(QColor(m_advancedUi->fgColorButton->property("color").toString()));
|
entry->setForegroundColor(m_advancedUi->fgColorButton->property("color").toString());
|
||||||
} else {
|
} else {
|
||||||
entry->setForegroundColor(QColor());
|
entry->setForegroundColor(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_advancedUi->bgColorCheckBox->isChecked() && m_advancedUi->bgColorButton->property("color").isValid()) {
|
if (m_advancedUi->bgColorCheckBox->isChecked() && m_advancedUi->bgColorButton->property("color").isValid()) {
|
||||||
entry->setBackgroundColor(QColor(m_advancedUi->bgColorButton->property("color").toString()));
|
entry->setBackgroundColor(m_advancedUi->bgColorButton->property("color").toString());
|
||||||
} else {
|
} else {
|
||||||
entry->setBackgroundColor(QColor());
|
entry->setBackgroundColor(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
IconStruct iconStruct = m_iconsWidget->state();
|
IconStruct iconStruct = m_iconsWidget->state();
|
||||||
|
@ -271,6 +271,8 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
|||||||
}
|
}
|
||||||
return font;
|
return font;
|
||||||
} else if (role == Qt::ForegroundRole) {
|
} else if (role == Qt::ForegroundRole) {
|
||||||
|
QColor foregroundColor;
|
||||||
|
foregroundColor.setNamedColor(entry->foregroundColor());
|
||||||
if (entry->hasReferences()) {
|
if (entry->hasReferences()) {
|
||||||
QPalette p;
|
QPalette p;
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
@ -279,12 +281,14 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return QVariant(p.color(QPalette::Active, QPalette::Mid));
|
return QVariant(p.color(QPalette::Active, QPalette::Mid));
|
||||||
} else if (entry->foregroundColor().isValid()) {
|
} else if (foregroundColor.isValid()) {
|
||||||
return QVariant(entry->foregroundColor());
|
return QVariant(foregroundColor);
|
||||||
}
|
}
|
||||||
} else if (role == Qt::BackgroundRole) {
|
} else if (role == Qt::BackgroundRole) {
|
||||||
if (entry->backgroundColor().isValid()) {
|
QColor backgroundColor;
|
||||||
return QVariant(entry->backgroundColor());
|
backgroundColor.setNamedColor(entry->backgroundColor());
|
||||||
|
if (backgroundColor.isValid()) {
|
||||||
|
return QVariant(backgroundColor);
|
||||||
}
|
}
|
||||||
} else if (role == Qt::TextAlignmentRole) {
|
} else if (role == Qt::TextAlignmentRole) {
|
||||||
if (index.column() == Paperclip) {
|
if (index.column() == Paperclip) {
|
||||||
|
@ -86,7 +86,7 @@ void TestKeePass2Format::testXmlMetadata()
|
|||||||
QCOMPARE(m_xmlDb->metadata()->defaultUserName(), QString("DEFUSERNAME"));
|
QCOMPARE(m_xmlDb->metadata()->defaultUserName(), QString("DEFUSERNAME"));
|
||||||
QCOMPARE(m_xmlDb->metadata()->defaultUserNameChanged(), MockClock::datetimeUtc(2010, 8, 8, 17, 27, 45));
|
QCOMPARE(m_xmlDb->metadata()->defaultUserNameChanged(), MockClock::datetimeUtc(2010, 8, 8, 17, 27, 45));
|
||||||
QCOMPARE(m_xmlDb->metadata()->maintenanceHistoryDays(), 127);
|
QCOMPARE(m_xmlDb->metadata()->maintenanceHistoryDays(), 127);
|
||||||
QCOMPARE(m_xmlDb->metadata()->color(), QColor(0xff, 0xef, 0x00));
|
QCOMPARE(m_xmlDb->metadata()->color(), QString("#FFEF00"));
|
||||||
QCOMPARE(m_xmlDb->metadata()->masterKeyChanged(), MockClock::datetimeUtc(2012, 4, 5, 17, 9, 34));
|
QCOMPARE(m_xmlDb->metadata()->masterKeyChanged(), MockClock::datetimeUtc(2012, 4, 5, 17, 9, 34));
|
||||||
QCOMPARE(m_xmlDb->metadata()->masterKeyChangeRec(), 101);
|
QCOMPARE(m_xmlDb->metadata()->masterKeyChangeRec(), 101);
|
||||||
QCOMPARE(m_xmlDb->metadata()->masterKeyChangeForce(), -1);
|
QCOMPARE(m_xmlDb->metadata()->masterKeyChangeForce(), -1);
|
||||||
@ -200,8 +200,8 @@ void TestKeePass2Format::testXmlEntry1()
|
|||||||
QCOMPARE(entry->historyItems().size(), 2);
|
QCOMPARE(entry->historyItems().size(), 2);
|
||||||
QCOMPARE(entry->iconNumber(), 0);
|
QCOMPARE(entry->iconNumber(), 0);
|
||||||
QCOMPARE(entry->iconUuid(), QUuid());
|
QCOMPARE(entry->iconUuid(), QUuid());
|
||||||
QVERIFY(!entry->foregroundColor().isValid());
|
QVERIFY(entry->foregroundColor().isEmpty());
|
||||||
QVERIFY(!entry->backgroundColor().isValid());
|
QVERIFY(entry->backgroundColor().isEmpty());
|
||||||
QCOMPARE(entry->overrideUrl(), QString(""));
|
QCOMPARE(entry->overrideUrl(), QString(""));
|
||||||
QCOMPARE(entry->tags(), QString("a b c"));
|
QCOMPARE(entry->tags(), QString("a b c"));
|
||||||
|
|
||||||
@ -262,8 +262,8 @@ void TestKeePass2Format::testXmlEntry2()
|
|||||||
QCOMPARE(entry->iconNumber(), 0);
|
QCOMPARE(entry->iconNumber(), 0);
|
||||||
QCOMPARE(entry->iconUuid(), QUuid::fromRfc4122(QByteArray::fromBase64("++vyI+daLk6omox4a6kQGA==")));
|
QCOMPARE(entry->iconUuid(), QUuid::fromRfc4122(QByteArray::fromBase64("++vyI+daLk6omox4a6kQGA==")));
|
||||||
// TODO: test entry->icon()
|
// TODO: test entry->icon()
|
||||||
QCOMPARE(entry->foregroundColor(), QColor(255, 0, 0));
|
QCOMPARE(entry->foregroundColor(), QString("#FF0000"));
|
||||||
QCOMPARE(entry->backgroundColor(), QColor(255, 255, 0));
|
QCOMPARE(entry->backgroundColor(), QString("#FFFF00"));
|
||||||
QCOMPARE(entry->overrideUrl(), QString("http://override.net/"));
|
QCOMPARE(entry->overrideUrl(), QString("http://override.net/"));
|
||||||
QCOMPARE(entry->tags(), QString(""));
|
QCOMPARE(entry->tags(), QString(""));
|
||||||
|
|
||||||
|
@ -309,13 +309,13 @@ void TestModified::testEntrySets()
|
|||||||
entry->setDefaultAutoTypeSequence(entry->defaultAutoTypeSequence());
|
entry->setDefaultAutoTypeSequence(entry->defaultAutoTypeSequence());
|
||||||
QTRY_COMPARE(spyModified.count(), spyCount);
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
||||||
|
|
||||||
entry->setForegroundColor(Qt::red);
|
entry->setForegroundColor(QString("#FF0000"));
|
||||||
++spyCount;
|
++spyCount;
|
||||||
QTRY_COMPARE(spyModified.count(), spyCount);
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
||||||
entry->setForegroundColor(entry->foregroundColor());
|
entry->setForegroundColor(entry->foregroundColor());
|
||||||
QTRY_COMPARE(spyModified.count(), spyCount);
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
||||||
|
|
||||||
entry->setBackgroundColor(Qt::red);
|
entry->setBackgroundColor(QString("#FF0000"));
|
||||||
++spyCount;
|
++spyCount;
|
||||||
QTRY_COMPARE(spyModified.count(), spyCount);
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
||||||
entry->setBackgroundColor(entry->backgroundColor());
|
entry->setBackgroundColor(entry->backgroundColor());
|
||||||
|
@ -432,8 +432,8 @@ void TestGui::testEditEntry()
|
|||||||
|
|
||||||
// Test entry colors (simulate choosing a color)
|
// Test entry colors (simulate choosing a color)
|
||||||
editEntryWidget->setCurrentPage(1);
|
editEntryWidget->setCurrentPage(1);
|
||||||
auto fgColor = QColor(Qt::red);
|
auto fgColor = QString("#FF0000");
|
||||||
auto bgColor = QColor(Qt::blue);
|
auto bgColor = QString("#0000FF");
|
||||||
// Set foreground color
|
// Set foreground color
|
||||||
auto colorButton = editEntryWidget->findChild<QPushButton*>("fgColorButton");
|
auto colorButton = editEntryWidget->findChild<QPushButton*>("fgColorButton");
|
||||||
auto colorCheckBox = editEntryWidget->findChild<QCheckBox*>("fgColorCheckBox");
|
auto colorCheckBox = editEntryWidget->findChild<QCheckBox*>("fgColorCheckBox");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user