diff --git a/src/plugins/projectexplorer/clangparser.cpp b/src/plugins/projectexplorer/clangparser.cpp index 8409d788322..029b6fc8583 100644 --- a/src/plugins/projectexplorer/clangparser.cpp +++ b/src/plugins/projectexplorer/clangparser.cpp @@ -281,16 +281,6 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << CompileTask(Task::Error, "code signing is required for product type 'Application' in SDK 'iOS 7.0'")) << QString(); - - QTest::newRow("moc note") - << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") - << OutputParserTester::STDERR - << QString() << QString() - << (Tasks() - << CompileTask(Task::Unknown, - "Note: No relevant classes found. No output generated.", - FilePath::fromUserInput("/home/qtwebkithelpviewer.h"))) - << QString(); } void ProjectExplorerPlugin::testClangOutputParser() diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index 33f820a34f1..6e732a0b921 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -883,16 +883,6 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() FilePath::fromUserInput("cns5k_ins_parser_tests.cpp"))) << QString(); - QTest::newRow("uic warning") - << QString::fromLatin1("mainwindow.ui: Warning: The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'.") - << OutputParserTester::STDERR - << QString() << QString() - << (Tasks() - << CompileTask(Task::Warning, - "The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'.", - FilePath::fromUserInput("mainwindow.ui"))) - << QString(); - QTest::newRow("libimf warning") << QString::fromLatin1("libimf.so: warning: warning: feupdateenv is not implemented and will always fail") << OutputParserTester::STDERR @@ -1169,16 +1159,6 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "file: lib/libtest.a(Test0.cpp.o) has no symbols")) << QString(); - QTest::newRow("moc note") - << QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.") - << OutputParserTester::STDERR - << QString() << QString() - << (Tasks() - << CompileTask(Task::Unknown, - "Note: No relevant classes found. No output generated.", - FilePath::fromUserInput("/home/qtwebkithelpviewer.h"))) - << QString(); - QTest::newRow("GCC 9 output") << QString("In file included from /usr/include/qt/QtCore/qlocale.h:43,\n" " from /usr/include/qt/QtCore/qtextstream.h:46,\n" diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index 41d46a35221..dd1b295e345 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -217,16 +217,6 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() "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() - << CompileTask(Task::Unknown, - "Note: No relevant classes found. No output generated.", - FilePath::fromUserInput("/home/qtwebkithelpviewer.h"), -1)) - << QString(); } void ProjectExplorerPlugin::testLinuxIccOutputParsers() diff --git a/src/plugins/qtsupport/qtparser.cpp b/src/plugins/qtsupport/qtparser.cpp index 7265f45c64d..5fb0d4d73cb 100644 --- a/src/plugins/qtsupport/qtparser.cpp +++ b/src/plugins/qtsupport/qtparser.cpp @@ -45,6 +45,7 @@ namespace QtSupport { QtParser::QtParser() : m_mocRegExp(QLatin1String(FILE_PATTERN"[:\\(](\\d+?)\\)?:\\s([Ww]arning|[Ee]rror|[Nn]ote):\\s(.+?)$")), + m_uicRegExp(QLatin1String(FILE_PATTERN": Warning:\\s(?.+?)$")), m_translationRegExp(QLatin1String("^([Ww]arning|[Ee]rror):\\s+(.*?) in '(.*?)'$")) { setObjectName(QLatin1String("QtParser")); @@ -76,6 +77,26 @@ Utils::OutputLineParser::Result QtParser::handleLine(const QString &line, Utils: scheduleTask(task, 1); return {Status::Done, linkSpecs}; } + match = m_uicRegExp.match(lne); + if (match.hasMatch()) { + const QString fileName = match.captured(1); + QString message = match.captured("msg").trimmed(); + Utils::FilePath filePath; + LinkSpecs linkSpecs; + bool isUicMessage = true; + if (fileName == "uic" || fileName == "stdin") { + message.prepend(": ").prepend(fileName); + } else if (fileName.endsWith(".ui")) { + filePath = absoluteFilePath(Utils::FilePath::fromUserInput(fileName)); + addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, -1, match, 1); + } else { + isUicMessage = false; + } + if (isUicMessage) { + scheduleTask(CompileTask(Task::Warning, message, filePath), 1); + return {Status::Done, linkSpecs}; + } + } match = m_translationRegExp.match(line); if (match.hasMatch()) { Task::TaskType type = Task::Warning; @@ -172,6 +193,15 @@ void QtSupportPlugin::testQtOutputParser_data() QLatin1String("Undefined interface"), Utils::FilePath::fromUserInput(QLatin1String("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h")), 54)) << QString(); + QTest::newRow("uic warning") + << QString::fromLatin1("mainwindow.ui: Warning: The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'.") + << OutputParserTester::STDERR + << QString() << QString() + << (Tasks() + << CompileTask(Task::Warning, + "The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'.", + Utils::FilePath::fromUserInput("mainwindow.ui"))) + << QString(); QTest::newRow("translation") << QString::fromLatin1("Warning: dropping duplicate messages in '/some/place/qtcreator_fr.qm'") << OutputParserTester::STDERR diff --git a/src/plugins/qtsupport/qtparser.h b/src/plugins/qtsupport/qtparser.h index ad6c9d5d357..8e47b6b66ec 100644 --- a/src/plugins/qtsupport/qtparser.h +++ b/src/plugins/qtsupport/qtparser.h @@ -45,6 +45,7 @@ private: Result handleLine(const QString &line, Utils::OutputFormat type) override; QRegularExpression m_mocRegExp; + QRegularExpression m_uicRegExp; QRegularExpression m_translationRegExp; };