Removing QWidget dependency from src/core.

This commit is contained in:
louib 2021-03-13 14:07:49 -05:00 committed by Jonathan White
parent 6f5bbf7ad1
commit 004f2b6801
46 changed files with 298 additions and 313 deletions

View file

@ -17,7 +17,7 @@
#include "KdbxXmlReader.h"
#include "KeePass2RandomStream.h"
#include "core/DatabaseIcons.h"
#include "core/Clock.h"
#include "core/Endian.h"
#include "core/Group.h"
#include "core/Tools.h"
@ -346,7 +346,7 @@ void KdbxXmlReader::parseIcon()
Q_ASSERT(m_xml.isStartElement() && m_xml.name() == "Icon");
QUuid uuid;
QImage icon;
QByteArray iconData;
bool uuidSet = false;
bool iconSet = false;
@ -355,7 +355,7 @@ void KdbxXmlReader::parseIcon()
uuid = readUuid();
uuidSet = !uuid.isNull();
} else if (m_xml.name() == "Data") {
icon.loadFromData(readBinary());
iconData = readBinary();
iconSet = true;
} else {
skipCurrentElement();
@ -367,7 +367,7 @@ void KdbxXmlReader::parseIcon()
if (m_meta->hasCustomIcon(uuid)) {
uuid = QUuid::createUuid();
}
m_meta->addCustomIcon(uuid, icon);
m_meta->addCustomIcon(uuid, iconData);
return;
}
@ -509,9 +509,6 @@ Group* KdbxXmlReader::parseGroup()
raiseError(tr("Invalid group icon number"));
}
iconId = 0;
} else if (iconId >= databaseIcons()->count()) {
qWarning("KdbxXmlReader::parseGroup: icon id \"%d\" not supported", iconId);
iconId = databaseIcons()->count() - 1;
}
group->setIcon(iconId);