forked from qt-creator/qt-creator
CMake: Use new MessageManager API
Flash when CMake is started, write all other output silently. This avoids re-popping up the general messages pane all the time. When an error occurs, that is put into the issues pane, so no need to pop up the general messages pane for that either. Task-number: QTCREATORBUG-24430 Change-Id: I07ae4182cbc43147fbb343b360baf9da7e65f224 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -117,9 +117,8 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &
|
||||
|
||||
TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
|
||||
|
||||
Core::MessageManager::write(tr("Running %1 in %2.")
|
||||
.arg(commandLine.toUserOutput())
|
||||
.arg(workDirectory.toUserOutput()));
|
||||
Core::MessageManager::writeFlashing(
|
||||
tr("Running %1 in %2.").arg(commandLine.toUserOutput()).arg(workDirectory.toUserOutput()));
|
||||
|
||||
auto future = std::make_unique<QFutureInterface<void>>();
|
||||
future->setProgressRange(0, 1);
|
||||
@@ -168,9 +167,9 @@ void CMakeProcess::processStandardOutput()
|
||||
QTC_ASSERT(m_process, return);
|
||||
|
||||
static QString rest;
|
||||
rest = lineSplit(rest, m_process->readAllStandardOutput(),
|
||||
[](const QString &s) { Core::MessageManager::write(s); });
|
||||
|
||||
rest = lineSplit(rest, m_process->readAllStandardOutput(), [](const QString &s) {
|
||||
Core::MessageManager::writeSilently(s);
|
||||
});
|
||||
}
|
||||
|
||||
void CMakeProcess::processStandardError()
|
||||
@@ -180,7 +179,7 @@ void CMakeProcess::processStandardError()
|
||||
static QString rest;
|
||||
rest = lineSplit(rest, m_process->readAllStandardError(), [this](const QString &s) {
|
||||
m_parser.appendMessage(s + '\n', Utils::StdErrFormat);
|
||||
Core::MessageManager::write(s);
|
||||
Core::MessageManager::writeSilently(s);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -206,7 +205,7 @@ void CMakeProcess::handleProcessFinished(int code, QProcess::ExitStatus status)
|
||||
m_lastExitCode = code;
|
||||
|
||||
if (!msg.isEmpty()) {
|
||||
Core::MessageManager::write(msg);
|
||||
Core::MessageManager::writeSilently(msg);
|
||||
TaskHub::addTask(BuildSystemTask(Task::Error, msg));
|
||||
m_future->reportCanceled();
|
||||
} else {
|
||||
@@ -218,7 +217,7 @@ void CMakeProcess::handleProcessFinished(int code, QProcess::ExitStatus status)
|
||||
emit finished(code, status);
|
||||
|
||||
const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed());
|
||||
Core::MessageManager::write(elapsedTime);
|
||||
Core::MessageManager::writeSilently(elapsedTime);
|
||||
}
|
||||
|
||||
void CMakeProcess::checkForCancelled()
|
||||
|
@@ -281,8 +281,8 @@ void CMakeManager::buildFile(Node *node)
|
||||
bc->buildDirectory());
|
||||
targetBase = relativeBuildDir / "CMakeFiles" / (targetNode->displayName() + ".dir");
|
||||
} else if (!generator.contains("Makefiles")) {
|
||||
Core::MessageManager::write(tr("Build File is not supported for generator \"%1\"")
|
||||
.arg(generator));
|
||||
Core::MessageManager::writeFlashing(
|
||||
tr("Build File is not supported for generator \"%1\"").arg(generator));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -61,10 +61,11 @@ static FilePath cmakeReplyDirectory(const FilePath &buildDirectory)
|
||||
|
||||
static void reportFileApiSetupFailure()
|
||||
{
|
||||
Core::MessageManager::write(QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
Core::MessageManager::writeFlashing(
|
||||
QCoreApplication::translate("CMakeProjectManager::Internal",
|
||||
"Failed to set up CMake file API support. %1 cannot "
|
||||
"extract project information.").arg(Core::Constants::IDE_DISPLAY_NAME));
|
||||
"extract project information.")
|
||||
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
||||
}
|
||||
|
||||
static std::pair<int, int> cmakeVersion(const QJsonObject &obj)
|
||||
|
Reference in New Issue
Block a user