diff options
author | hjk <hjk@qt.io> | 2020-01-15 08:56:11 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-01-20 10:11:59 +0000 |
commit | 0334b6e491a3688f2455e075595afde87b8f76af (patch) | |
tree | cc63a1fae976a46ea6ddc5d2cb956d1d7ac37516 /src/plugins/projectexplorer/linuxiccparser.cpp | |
parent | 7e19d1af7c356dae703e110f9d24b75429ef8fb5 (diff) |
ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.
Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/linuxiccparser.cpp')
-rw-r--r-- | src/plugins/projectexplorer/linuxiccparser.cpp | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index a333d00ca5..95ccb4dfce 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -31,6 +31,7 @@ #include <utils/qtcassert.h> using namespace ProjectExplorer; +using namespace Utils; LinuxIccParser::LinuxIccParser() : m_temporary(Task()) @@ -82,10 +83,10 @@ void LinuxIccParser::stdError(const QString &line) type = Task::Error; else if (category == QLatin1String("warning")) type = Task::Warning; - m_temporary = Task(type, m_firstLine.cap(6).trimmed(), - Utils::FilePath::fromUserInput(m_firstLine.cap(1)), - m_firstLine.cap(2).toInt(), - Constants::TASK_CATEGORY_COMPILE); + m_temporary = CompileTask(type, + m_firstLine.cap(6).trimmed(), + Utils::FilePath::fromUserInput(m_firstLine.cap(1)), + m_firstLine.cap(2).toInt()); m_lines = 1; m_expectFirstLine = false; @@ -172,10 +173,9 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString::fromLatin1("\n") << (Tasks() - << Task(Task::Error, - QLatin1String("identifier \"f\" is undefined\nf(0);"), - Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 13, - Constants::TASK_CATEGORY_COMPILE)) + << CompileTask(Task::Error, + "identifier \"f\" is undefined\nf(0);", + FilePath::fromUserInput(QLatin1String("main.cpp")), 13)) << QString(); // same, with PCH remark @@ -188,10 +188,9 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString::fromLatin1("\n") << (Tasks() - << Task(Task::Error, - QLatin1String("identifier \"f\" is undefined\nf(0);"), - Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 13, - Constants::TASK_CATEGORY_COMPILE)) + << CompileTask(Task::Error, + "identifier \"f\" is undefined\nf(0);", + FilePath::fromUserInput("main.cpp"), 13)) << QString(); @@ -203,10 +202,9 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString::fromLatin1("\n") << (Tasks() - << Task(Task::Error, - QLatin1String("function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\nb.privatefunc();"), - Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 53, - Constants::TASK_CATEGORY_COMPILE)) + << CompileTask(Task::Error, + "function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\nb.privatefunc();", + FilePath::fromUserInput("main.cpp"), 53)) << QString(); QTest::newRow("simple warning") @@ -217,21 +215,19 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString::fromLatin1("\n") << (Tasks() - << Task(Task::Warning, - QLatin1String("use of \"=\" where \"==\" may have been intended\nwhile (a = true)"), - Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 41, - Constants::TASK_CATEGORY_COMPILE)) + << CompileTask(Task::Warning, + "use of \"=\" where \"==\" may have been intended\nwhile (a = true)", + FilePath::fromUserInput("main.cpp"), 41)) << QString(); + QTest::newRow("moc note") << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << Task(Task::Unknown, - QLatin1String("Note: No relevant classes found. No output generated."), - Utils::FilePath::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, - Constants::TASK_CATEGORY_COMPILE) - ) + << CompileTask(Task::Unknown, + "Note: No relevant classes found. No output generated.", + FilePath::fromUserInput("/home/qtwebkithelpviewer.h"), 0)) << QString(); } |