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)
|
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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user