forked from qt-creator/qt-creator
Qbs: Avoid popping up general messages pane
Except on direct user action. Use more evocative message manager API. Task-number: QTCREATORBUG-24430 Change-Id: I44c6088904b2018baccb72cd3651e2ab62dc1358 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -354,8 +354,8 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
|
|||||||
|
|
||||||
if (tcC && tcCxx && !cCompilerPath.isEmpty() && !cxxCompilerPath.isEmpty()
|
if (tcC && tcCxx && !cCompilerPath.isEmpty() && !cxxCompilerPath.isEmpty()
|
||||||
&& cFileInfo.absolutePath() != cxxFileInfo.absolutePath()) {
|
&& cFileInfo.absolutePath() != cxxFileInfo.absolutePath()) {
|
||||||
Core::MessageManager::write(tr("C and C++ compiler paths differ. C compiler may not work."),
|
Core::MessageManager::writeFlashing(
|
||||||
Core::MessageManager::ModeSwitch);
|
tr("C and C++ compiler paths differ. C compiler may not work."));
|
||||||
}
|
}
|
||||||
data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFileInfo.absolutePath());
|
data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFileInfo.absolutePath());
|
||||||
|
|
||||||
|
@@ -252,10 +252,12 @@ QString QbsProfileManager::runQbsConfig(QbsConfigOp op, const QString &key, cons
|
|||||||
return {};
|
return {};
|
||||||
qbsConfig.start(qbsExe.toString(), args);
|
qbsConfig.start(qbsExe.toString(), args);
|
||||||
if (!qbsConfig.waitForStarted(3000) || !qbsConfig.waitForFinished(5000)) {
|
if (!qbsConfig.waitForStarted(3000) || !qbsConfig.waitForFinished(5000)) {
|
||||||
Core::MessageManager::write(tr("Failed run qbs config: %1").arg(qbsConfig.errorString()));
|
Core::MessageManager::writeFlashing(
|
||||||
|
tr("Failed to run qbs config: %1").arg(qbsConfig.errorString()));
|
||||||
} else if (qbsConfig.exitCode() != 0) {
|
} else if (qbsConfig.exitCode() != 0) {
|
||||||
Core::MessageManager::write(tr("Failed to run qbs config: %1")
|
Core::MessageManager::writeFlashing(
|
||||||
.arg(QString::fromLocal8Bit(qbsConfig.readAllStandardError())));
|
tr("Failed to run qbs config: %1")
|
||||||
|
.arg(QString::fromLocal8Bit(qbsConfig.readAllStandardError())));
|
||||||
}
|
}
|
||||||
return QString::fromLocal8Bit(qbsConfig.readAllStandardOutput()).trimmed();
|
return QString::fromLocal8Bit(qbsConfig.readAllStandardOutput()).trimmed();
|
||||||
}
|
}
|
||||||
|
@@ -103,8 +103,8 @@ public:
|
|||||||
~OpTimer()
|
~OpTimer()
|
||||||
{
|
{
|
||||||
if (qEnvironmentVariableIsSet(Constants::QBS_PROFILING_ENV)) {
|
if (qEnvironmentVariableIsSet(Constants::QBS_PROFILING_ENV)) {
|
||||||
MessageManager::write(QString("operation %1 took %2ms")
|
MessageManager::writeSilently(
|
||||||
.arg(QLatin1String(m_name)).arg(m_timer.elapsed()));
|
QString("operation %1 took %2ms").arg(QLatin1String(m_name)).arg(m_timer.elapsed()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ bool QbsBuildSystem::addFilesToProduct(
|
|||||||
product.value("full-display-name").toString(),
|
product.value("full-display-name").toString(),
|
||||||
group.value("name").toString());
|
group.value("name").toString());
|
||||||
if (result.error().hasError()) {
|
if (result.error().hasError()) {
|
||||||
MessageManager::write(result.error().toString(), Core::MessageManager::ModeSwitch);
|
MessageManager::writeDisrupting(result.error().toString());
|
||||||
*notAdded = result.failedFiles();
|
*notAdded = result.failedFiles();
|
||||||
}
|
}
|
||||||
return notAdded->isEmpty();
|
return notAdded->isEmpty();
|
||||||
@@ -405,7 +405,7 @@ RemovedFilesFromProject QbsBuildSystem::removeFilesFromProduct(
|
|||||||
|
|
||||||
*notRemoved = result.failedFiles();
|
*notRemoved = result.failedFiles();
|
||||||
if (result.error().hasError())
|
if (result.error().hasError())
|
||||||
MessageManager::write(result.error().toString(), Core::MessageManager::ModeSwitch);
|
MessageManager::writeDisrupting(result.error().toString());
|
||||||
const bool success = notRemoved->isEmpty();
|
const bool success = notRemoved->isEmpty();
|
||||||
if (!wildcardFiles.isEmpty())
|
if (!wildcardFiles.isEmpty())
|
||||||
*notRemoved += wildcardFiles;
|
*notRemoved += wildcardFiles;
|
||||||
@@ -1126,8 +1126,8 @@ void QbsBuildSystem::updateApplicationTargets()
|
|||||||
RunEnvironmentResult result = session()->getRunEnvironment(productName, procEnv,
|
RunEnvironmentResult result = session()->getRunEnvironment(productName, procEnv,
|
||||||
setupRunEnvConfig);
|
setupRunEnvConfig);
|
||||||
if (result.error().hasError()) {
|
if (result.error().hasError()) {
|
||||||
Core::MessageManager::write(tr("Error retrieving run environment: %1")
|
Core::MessageManager::writeFlashing(
|
||||||
.arg(result.error().toString()));
|
tr("Error retrieving run environment: %1").arg(result.error().toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QProcessEnvironment fullEnv = result.environment();
|
QProcessEnvironment fullEnv = result.environment();
|
||||||
|
@@ -491,8 +491,7 @@ void QbsSession::handlePacket(const QJsonObject &packet)
|
|||||||
} else if (type == "install-done") {
|
} else if (type == "install-done") {
|
||||||
emit projectInstalled(getErrorInfo(packet));
|
emit projectInstalled(getErrorInfo(packet));
|
||||||
} else if (type == "log-data") {
|
} else if (type == "log-data") {
|
||||||
Core::MessageManager::write("[qbs] " + packet.value("message").toString(),
|
Core::MessageManager::writeSilently("[qbs] " + packet.value("message").toString());
|
||||||
Core::MessageManager::Silent);
|
|
||||||
} else if (type == "warning") {
|
} else if (type == "warning") {
|
||||||
const ErrorInfo errorInfo = ErrorInfo(packet.value("warning").toObject());
|
const ErrorInfo errorInfo = ErrorInfo(packet.value("warning").toObject());
|
||||||
|
|
||||||
@@ -618,11 +617,10 @@ void QbsSession::handleFileListUpdated(const QJsonObject &reply)
|
|||||||
setProjectDataFromReply(reply, false);
|
setProjectDataFromReply(reply, false);
|
||||||
const QStringList failedFiles = arrayToStringList(reply.value("failed-files"));
|
const QStringList failedFiles = arrayToStringList(reply.value("failed-files"));
|
||||||
if (!failedFiles.isEmpty()) {
|
if (!failedFiles.isEmpty()) {
|
||||||
Core::MessageManager::write(tr("Failed to update files in Qbs project: %1.\n"
|
Core::MessageManager::writeFlashing(
|
||||||
"The affected files are: \n\t%2")
|
tr("Failed to update files in Qbs project: %1.\n"
|
||||||
.arg(getErrorInfo(reply).toString(),
|
"The affected files are: \n\t%2")
|
||||||
failedFiles.join("\n\t")),
|
.arg(getErrorInfo(reply).toString(), failedFiles.join("\n\t")));
|
||||||
Core::MessageManager::ModeSwitch);
|
|
||||||
}
|
}
|
||||||
emit fileListUpdated();
|
emit fileListUpdated();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user