forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.0'
Change-Id: I89c52ca2145a43c94d3366367ba72fde605dd577
This commit is contained in:
@@ -79,6 +79,10 @@ void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message,
|
||||
|
||||
{
|
||||
QMutexLocker l(&m_mutex);
|
||||
if (level <= qbs::LoggerWarning) {
|
||||
doPrintWarning(qbs::ErrorInfo(message));
|
||||
return;
|
||||
}
|
||||
m_messages.append(qbs::logLevelTag(level) + message);
|
||||
}
|
||||
QMetaObject::invokeMethod(this, "sendMessages", Qt::QueuedConnection);
|
||||
|
||||
@@ -77,7 +77,7 @@ QbsManager::QbsManager() : m_defaultPropertyProvider(new DefaultPropertyProvider
|
||||
this, &QbsManager::updateAllProfiles);
|
||||
|
||||
m_logSink = new QbsLogSink(this);
|
||||
int level = qbs::LoggerWarning;
|
||||
int level = qbs::LoggerInfo;
|
||||
const QString levelEnv = QString::fromLocal8Bit(qgetenv("QBS_LOG_LEVEL"));
|
||||
if (!levelEnv.isEmpty()) {
|
||||
bool ok = false;
|
||||
|
||||
@@ -59,18 +59,18 @@ QbsProjectParser::QbsProjectParser(QbsProject *project, QFutureInterface<bool> *
|
||||
|
||||
QbsProjectParser::~QbsProjectParser()
|
||||
{
|
||||
if (m_qbsSetupProjectJob) {
|
||||
m_qbsSetupProjectJob->disconnect(this);
|
||||
m_qbsSetupProjectJob->cancel();
|
||||
m_qbsSetupProjectJob->deleteLater();
|
||||
m_qbsSetupProjectJob = 0;
|
||||
}
|
||||
if (m_ruleExecutionJob) {
|
||||
m_ruleExecutionJob->disconnect(this);
|
||||
m_ruleExecutionJob->cancel();
|
||||
m_ruleExecutionJob->deleteLater();
|
||||
m_ruleExecutionJob = 0;
|
||||
}
|
||||
const auto deleteJob = [this](qbs::AbstractJob *job) {
|
||||
if (!job)
|
||||
return;
|
||||
if (job->state() == qbs::AbstractJob::StateFinished) {
|
||||
job->deleteLater();
|
||||
return;
|
||||
}
|
||||
connect(job, &qbs::AbstractJob::finished, job, &qbs::AbstractJob::deleteLater);
|
||||
job->cancel();
|
||||
};
|
||||
deleteJob(m_qbsSetupProjectJob);
|
||||
deleteJob(m_ruleExecutionJob);
|
||||
m_fi = 0; // we do not own m_fi, do not delete
|
||||
}
|
||||
|
||||
@@ -93,7 +93,8 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
|
||||
|
||||
// Some people don't like it when files are created as a side effect of opening a project,
|
||||
// so do not store the build graph if the build directory does not exist yet.
|
||||
params.setDryRun(!QFileInfo::exists(dir));
|
||||
m_dryRun = !QFileInfo::exists(dir);
|
||||
params.setDryRun(m_dryRun);
|
||||
|
||||
params.setBuildRoot(dir);
|
||||
params.setProjectFilePath(m_projectFilePath);
|
||||
@@ -151,6 +152,7 @@ void QbsProjectParser::handleQbsParsingDone(bool success)
|
||||
void QbsProjectParser::startRuleExecution()
|
||||
{
|
||||
qbs::BuildOptions options;
|
||||
options.setDryRun(m_dryRun);
|
||||
options.setExecuteRulesOnly(true);
|
||||
m_ruleExecutionJob = m_project.buildAllProducts(
|
||||
options, qbs::Project::ProductSelectionWithNonDefault, this);
|
||||
|
||||
@@ -74,6 +74,7 @@ private:
|
||||
qbs::BuildJob *m_ruleExecutionJob;
|
||||
qbs::ErrorInfo m_error;
|
||||
qbs::Project m_project;
|
||||
bool m_dryRun;
|
||||
|
||||
QFutureInterface<bool> *m_fi;
|
||||
int m_currentProgressBase;
|
||||
|
||||
Reference in New Issue
Block a user