Fix ticket #437 (Compile warnings in GUI (in Linux))

https://sourceforge.net/apps/trac/cppcheck/ticket/437
Add empty cases for XML element types we don't need to handle.
This commit is contained in:
Kimmo Varis 2009-06-23 09:15:00 +03:00
parent 85f8ba79a6
commit df241441dc
1 changed files with 28 additions and 1 deletions

View File

@ -56,6 +56,8 @@ bool ProjectFile::Read(const QString &filename)
case QXmlStreamReader::StartElement:
if (xmlReader.name() == ProjectElementName)
insideProject = true;
// Find allocelement from inside project element
if (insideProject && xmlReader.name() == AllocElementName)
ReadAutoAllocClasses(xmlReader);
break;
@ -64,6 +66,18 @@ bool ProjectFile::Read(const QString &filename)
if (xmlReader.name() == ProjectElementName)
insideProject = false;
break;
// Not handled
case QXmlStreamReader::NoToken:
case QXmlStreamReader::Invalid:
case QXmlStreamReader::StartDocument:
case QXmlStreamReader::EndDocument:
case QXmlStreamReader::Characters:
case QXmlStreamReader::Comment:
case QXmlStreamReader::DTD:
case QXmlStreamReader::EntityReference:
case QXmlStreamReader::ProcessingInstruction:
break;
}
}
@ -86,6 +100,8 @@ void ProjectFile::ReadAutoAllocClasses(QXmlStreamReader &reader)
switch (type)
{
case QXmlStreamReader::StartElement:
// Read class-elements
if (reader.name().toString() == ClassElementName)
{
QXmlStreamAttributes attribs = reader.attributes();
@ -99,8 +115,19 @@ void ProjectFile::ReadAutoAllocClasses(QXmlStreamReader &reader)
if (reader.name().toString() == AllocElementName)
allRead = true;
break;
}
// Not handled
case QXmlStreamReader::NoToken:
case QXmlStreamReader::Invalid:
case QXmlStreamReader::StartDocument:
case QXmlStreamReader::EndDocument:
case QXmlStreamReader::Characters:
case QXmlStreamReader::Comment:
case QXmlStreamReader::DTD:
case QXmlStreamReader::EntityReference:
case QXmlStreamReader::ProcessingInstruction:
break;
}
}
while (!allRead);
}