From f0e711ac2330efce495155edc4ec163b85c99b4f Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Thu, 23 Sep 2010 00:21:36 +0200 Subject: [PATCH] Warn about unsupported icon ids. --- src/format/KeePass2XmlReader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/format/KeePass2XmlReader.cpp b/src/format/KeePass2XmlReader.cpp index 23bb4b7fc..605dc93aa 100644 --- a/src/format/KeePass2XmlReader.cpp +++ b/src/format/KeePass2XmlReader.cpp @@ -17,10 +17,10 @@ #include "KeePass2XmlReader.h" -#include #include #include "core/Database.h" +#include "core/DatabaseIcons.h" #include "core/Metadata.h" KeePass2XmlReader::KeePass2XmlReader() @@ -298,6 +298,9 @@ Group* KeePass2XmlReader::parseGroup() raiseError(); } else { + if (iconId >= DatabaseIcons::iconCount()) { + qWarning("KeePass2XmlReader::parseGroup: icon id \"%d\" not supported", iconId); + } group->setIcon(iconId); } } @@ -756,6 +759,6 @@ void KeePass2XmlReader::raiseError() void KeePass2XmlReader::skipCurrentElement() { - qWarning() << "KeePass2XmlReader::skipCurrentElement(): skip: " << m_xml.name(); + qWarning("KeePass2XmlReader::skipCurrentElement: skip element \"%s\"", qPrintable(m_xml.name().toString())); m_xml.skipCurrentElement(); }