forked from qt-creator/qt-creator
QbsProjectManager: Proliferate the use of FilePath
Also use path() instead of toString(). While this doesn't change anything as long as there is no remotely running QbsSession, path() would be the better choice then. Change-Id: Ief98536b34fe615f6b0be03cb3072df7b69f293b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -616,7 +616,7 @@ void QbsBuildSystem::parseCurrentBuildConfiguration()
|
|||||||
->expand(QbsSettings::defaultInstallDirTemplate()));
|
->expand(QbsSettings::defaultInstallDirTemplate()));
|
||||||
}
|
}
|
||||||
Environment env = m_buildConfiguration->environment();
|
Environment env = m_buildConfiguration->environment();
|
||||||
QString dir = m_buildConfiguration->buildDirectory().toString();
|
FilePath dir = m_buildConfiguration->buildDirectory();
|
||||||
|
|
||||||
m_guard = guardParsingRun();
|
m_guard = guardParsingRun();
|
||||||
|
|
||||||
|
@@ -16,15 +16,14 @@
|
|||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
// QbsProjectParser:
|
// QbsProjectParser:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
QbsProjectParser::QbsProjectParser(QbsBuildSystem *buildSystem, QFutureInterface<bool> *fi)
|
QbsProjectParser::QbsProjectParser(QbsBuildSystem *buildSystem, QFutureInterface<bool> *fi)
|
||||||
: m_projectFilePath(buildSystem->project()->projectFilePath().toString()),
|
: m_projectFilePath(buildSystem->project()->projectFilePath()),
|
||||||
m_session(buildSystem->session()),
|
m_session(buildSystem->session()),
|
||||||
m_fi(fi)
|
m_fi(fi)
|
||||||
{
|
{
|
||||||
@@ -40,8 +39,8 @@ QbsProjectParser::~QbsProjectParser()
|
|||||||
m_fi = nullptr; // we do not own m_fi, do not delete
|
m_fi = nullptr; // we do not own m_fi, do not delete
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, const QString &dir,
|
void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
|
||||||
const QString &configName)
|
const FilePath &dir, const QString &configName)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_session, return);
|
QTC_ASSERT(m_session, return);
|
||||||
QTC_ASSERT(!dir.isEmpty(), return);
|
QTC_ASSERT(!dir.isEmpty(), return);
|
||||||
@@ -61,10 +60,10 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
|
|||||||
|
|
||||||
// People don't like it when files are created as a side effect of opening a project,
|
// 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.
|
// so do not store the build graph if the build directory does not exist yet.
|
||||||
request.insert("dry-run", !QFileInfo::exists(dir));
|
request.insert("dry-run", !dir.exists());
|
||||||
|
|
||||||
request.insert("build-root", dir);
|
request.insert("build-root", dir.path());
|
||||||
request.insert("project-file-path", m_projectFilePath);
|
request.insert("project-file-path", m_projectFilePath.path());
|
||||||
request.insert("override-build-graph-data", true);
|
request.insert("override-build-graph-data", true);
|
||||||
static const auto envToJson = [](const Environment &env) {
|
static const auto envToJson = [](const Environment &env) {
|
||||||
QJsonObject envObj;
|
QJsonObject envObj;
|
||||||
@@ -108,5 +107,4 @@ void QbsProjectParser::cancel()
|
|||||||
m_session->cancelCurrentJob();
|
m_session->cancelCurrentJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // QbsProjectManager::Internal
|
||||||
} // namespace QbsProjectManager
|
|
||||||
|
@@ -11,8 +11,7 @@
|
|||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class QbsBuildSystem;
|
class QbsBuildSystem;
|
||||||
|
|
||||||
@@ -24,7 +23,9 @@ public:
|
|||||||
QbsProjectParser(QbsBuildSystem *buildSystem, QFutureInterface<bool> *fi);
|
QbsProjectParser(QbsBuildSystem *buildSystem, QFutureInterface<bool> *fi);
|
||||||
~QbsProjectParser() override;
|
~QbsProjectParser() override;
|
||||||
|
|
||||||
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir,
|
void parse(const QVariantMap &config,
|
||||||
|
const Utils::Environment &env,
|
||||||
|
const Utils::FilePath &dir,
|
||||||
const QString &configName);
|
const QString &configName);
|
||||||
void cancel();
|
void cancel();
|
||||||
Utils::Environment environment() const { return m_environment; }
|
Utils::Environment environment() const { return m_environment; }
|
||||||
@@ -38,7 +39,7 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Utils::Environment m_environment;
|
Utils::Environment m_environment;
|
||||||
const QString m_projectFilePath;
|
const Utils::FilePath m_projectFilePath;
|
||||||
QbsSession * const m_session;
|
QbsSession * const m_session;
|
||||||
ErrorInfo m_error;
|
ErrorInfo m_error;
|
||||||
QJsonObject m_projectData;
|
QJsonObject m_projectData;
|
||||||
@@ -46,5 +47,4 @@ private:
|
|||||||
QFutureInterface<bool> *m_fi = nullptr;
|
QFutureInterface<bool> *m_fi = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // QbsProjectManager::Internal
|
||||||
} // namespace QbsProjectManager
|
|
||||||
|
Reference in New Issue
Block a user