forked from qt-creator/qt-creator
Kit: Simplify code a bit
Change-Id: I5b092dacd6ebcbd3bf914829f2810c4b1d38c351 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -123,7 +123,8 @@ IOutputParser::~IOutputParser()
|
||||
|
||||
void IOutputParser::appendOutputParser(IOutputParser *parser)
|
||||
{
|
||||
QTC_ASSERT(parser, return);
|
||||
if (!parser)
|
||||
return;
|
||||
if (m_parser) {
|
||||
m_parser->appendOutputParser(parser);
|
||||
return;
|
||||
|
||||
@@ -398,17 +398,14 @@ void Kit::addToEnvironment(Utils::Environment &env) const
|
||||
|
||||
IOutputParser *Kit::createOutputParser() const
|
||||
{
|
||||
IOutputParser *last = 0;
|
||||
IOutputParser *first = 0;
|
||||
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||
foreach (KitInformation *ki, infoList) {
|
||||
IOutputParser *next = ki->createOutputParser(this);
|
||||
if (!first)
|
||||
first = next;
|
||||
if (last && next)
|
||||
last->appendOutputParser(next);
|
||||
if (next)
|
||||
last = next;
|
||||
else
|
||||
first->appendOutputParser(next);
|
||||
}
|
||||
return first;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user