Kit: Simplify code a bit

Change-Id: I5b092dacd6ebcbd3bf914829f2810c4b1d38c351
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2013-02-15 13:09:36 +01:00
parent 873838096f
commit 84e24dee82
2 changed files with 4 additions and 6 deletions

View File

@@ -123,7 +123,8 @@ IOutputParser::~IOutputParser()
void IOutputParser::appendOutputParser(IOutputParser *parser) void IOutputParser::appendOutputParser(IOutputParser *parser)
{ {
QTC_ASSERT(parser, return); if (!parser)
return;
if (m_parser) { if (m_parser) {
m_parser->appendOutputParser(parser); m_parser->appendOutputParser(parser);
return; return;

View File

@@ -398,17 +398,14 @@ void Kit::addToEnvironment(Utils::Environment &env) const
IOutputParser *Kit::createOutputParser() const IOutputParser *Kit::createOutputParser() const
{ {
IOutputParser *last = 0;
IOutputParser *first = 0; IOutputParser *first = 0;
QList<KitInformation *> infoList = KitManager::instance()->kitInformation(); QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
foreach (KitInformation *ki, infoList) { foreach (KitInformation *ki, infoList) {
IOutputParser *next = ki->createOutputParser(this); IOutputParser *next = ki->createOutputParser(this);
if (!first) if (!first)
first = next; first = next;
if (last && next) else
last->appendOutputParser(next); first->appendOutputParser(next);
if (next)
last = next;
} }
return first; return first;
} }